multipleSpline = {
const heightWindow = 500+35*data.length
const svg = html `<svg width="1000" height="${heightWindow}" />`
const line = d3.line()
.x(d => xScale(d.Wavelength))
.y(d => yScale(d.Property))
.curve(d3.curveBasis)
for (var i = 0; i < 5; i++) {
const selectText = 'path#spline_' + i
d3.select(svg)
.selectAll(selectText)
.data([data[i]])
.join("path")
.attr('class', 'data')
.attr('id', (d,i)=> 'spline_' + i)
.attr('d', (d) => line(d) )
.style('stroke', d => colors(d[0].Material))
.style('stroke-width', 3)
.style('fill', 'transparent')
.on('mouseover', () => {
d3.selectAll(selectText)
.transition()
.duration(100)
.style("stroke-width", 6)
})
.on('mouseout', () => {
d3.selectAll(selectText)
.transition()
.duration(100)
.style("stroke-width", 3)
})
}
d3.select(svg)
.append('g')
.attr('class', 'x-axis')
.attr('transform', `translate(0,${ height - margin.bottom })`)
.style('stroke-width', 2)
.style('opacity', 0.5)
.call(xAxis)
d3.select(svg)
.append('g')
.attr('class', 'y-axis')
.attr('transform', `translate(${ margin.left },0)`)
.style('stroke-width', 2)
.style('opacity', 0.5)
.call(yAxis)
const g = d3.select(svg).append('g');
const xAxisG = g.append('g')
const yAxisG = g.append('g')
const xLabel = xAxisG.append('text')
const yLabel = yAxisG.selectAll("text.yaxisLabel").data(data[0]).enter().append('text')
yAxisG.attr("stroke-width", 3)
xLabel
.attr('x', 450)
.attr('y', 485)
.attr('font-size', 12)
.attr('fill', 'black')
.text('Wavelength (μm)')
yAxisG.selectAll("text.yaxisLabel").data(data[0]).enter().append('text')
.attr("class","yaxisLabel")
.attr('x', 10)
.attr('font-size', 10)
.attr('fill', 'black')
.style("font", "Source Sans Pro")
.style("text-align","center")
.text(d => d.Property_name)
.attr('transform', 'rotate(-90, 150, 140)')
const colorLegendG = g.append('g')
.attr('transform', "translate(" + 50 +", 510)")
const colorLegend = legendcolor.legendColor()
.scale(colors)
.shape('circle')
.shapePadding(35)
colorLegendG.call(colorLegend)
return svg
}