function highlightLine()

in inflation-explorer/shared/js/explorer.js [422:459]


	function highlightLine(self) {
		let temp_key = d3.select(self).attr("data-id")
		let temp_class = d3.select(self).attr("class")
		temp_class = temp_class.split(" ")[0]
		console.log(temp_class)

		if (highlight.includes(temp_key)) {
			
			d3.selectAll('.chartLine').style("opacity", 0.2)
			d3.selectAll('circle').style("opacity", 0.2)
			d3.select(`path.${temp_class}`).attr("stroke", "red").style("opacity", 1)
			d3.select(`circle.${temp_class}`).attr("fill", "red").style("opacity", 1)
			d3.selectAll(`g.${temp_class}`).style("opacity", 1)

		}

		else if (temp_key == "All groups CPI") {
			// do noting
		}

		else {
		
			d3.selectAll(`g.All_groups_CPI`).style("opacity", 0.2)
			d3.selectAll(`g.highlight`).style("opacity", 0)
			d3.selectAll(`path.All_groups_CPI`).style("opacity", 0.7)
			d3.selectAll(`path.highlight`).style("opacity", 0.7)
			d3.selectAll('.chartLine').style("opacity", 0.2)
			d3.selectAll('circle').style("opacity", 0.2)
			// d3.selectALL(`circle`).style("opacity", 0.2)
			// d3.selectAll(`.lineLabels`).style("opacity", 0.2)

			d3.select(`path.${temp_class}`).attr("stroke", color(categories[temp_key])).style("opacity", 1)
			d3.select(`circle.${temp_class}`).attr("fill", color(categories[temp_key])).style("opacity", 1)
			d3.selectAll(`g.${temp_class}`).style("color", color(categories[temp_key])).style("opacity", 1)

		}
		
		}