svgnode= { const svg = d3.create('svg').attr('id', 'svg_vis1').attr('viewBox', [0,0,width, height]).style('background', secondary)
const wrapper = svg.append('g').attr("transform", `translate(${margin.left},${margin.top})`)
wrapper.selectAll('text').data(novel_titles).join('text').style('font-size', 12)
.style('fill', primary)
.attr('transform', d=> `translate(${x(d)}, ${-10}) rotate(-90)`).text(d => d)
wrapper.selectAll('circle').data(quote_dataset).join('circle').attr('cx', d=>x(d['Novel Title'])).attr('cy', d=>y(d.quote_pos)).attr('r', d=>r_scaler(d.quote_len)).style('fill', d=> {
if(d.speaker_gender == 'M') {
return c4
} else if (d.speaker_gender == 'F'){
return c2
} else {
return "#1e1e1e"
}
}).style('opacity', 0.75)
.attr('stroke','#1e1e1e').attr('stroke-width', 0.1)
// Author Gender: "M"
// quote_len: 16
// quote_pos: 44
// // special
// const arc = d3.arc()
// .innerRadius(d => y(0))
// .outerRadius(d => y(1))
// .startAngle(d => x(d.Title))
// .endAngle(d => x(d.Title) + x.bandwidth())
// .padAngle(0.05)
// .padRadius(innerRadius)
// //
// const arc_m = d3.arc()
// .cornerRadius(cornerR)
// .innerRadius(d => y(0))
// .outerRadius(d => y(d.M))
// .startAngle(d => x(d.Title))
// .endAngle(d => x(d.Title) + x.bandwidth())
// .padAngle(0.1)
// .padRadius(innerRadius)
// const arc_f = d3.arc()
// .cornerRadius(cornerR)
// .innerRadius(d => y(d.M + d.Other)+4)
// .outerRadius(d => y(1)+4)
// .startAngle(d => x(d.Title))
// .endAngle(d => x(d.Title) + x.bandwidth())
// .padAngle(0.1)
// .padRadius(innerRadius)
// chart.selectAll('.path-m').data(data).join('path').attr('d', arc_m)
// .style('fill', c4)
// chart.selectAll('.path-f').data(data).join('path').attr('d', arc_f)
// .style('fill', c2)
// let annotate_grouping = chart.selectAll('.anno_group').data(data).join('g').attr("transform", (d,i,arr) => `rotate(${ (x(d.Title)+x.step()/2)*(180/Math.PI)-90 }) translate(${outerRadius+10}, 0)`)
// // text
// annotate_grouping.append('text').style('font-size', 12)
// .style('fill', primary)
// .attr('dominant-baseline', 'central')
// .attr('transform', d => ((x(d.Title)+x.step()/2)*(180/Math.PI)-90 < -90) ? `rotate(180)` :`rotate(0)`)
// .attr('text-anchor', d => ((x(d.Title)+x.step()/2)*(180/Math.PI)-90 < -90) ? `end` :`begin`)
// .text(d => d.Title)
return svg.node()
}