viewof view_type = {
const element = html`
<div style="display: inline-block; user-select: none;"></div>`;
d3.select(element)
.selectAll('div')
.data(['2D', '3D'])
.join('span')
.style('min-width', '200px')
.style('max-width', '200px')
.style('margin-right', '10px')
.text(d => d)
.style('font-weight', '550px')
.style("font-family", "sans-serif")
.style("font-size", "16")
.style("text-anchor", "end")
.style('font-weight', 'bold')
.style('color', d => d === ini_view_type ? 'blue': '#808080')
.on('click', function(d){
d3.select(element).selectAll('span')
.style('color', '#808080')
d3.select(this)
.style('color', 'blue')
element.value = d.replace(', ', '')
element.dispatchEvent(new CustomEvent("input"));
})
element.value = ini_view_type
element.dispatchEvent(new CustomEvent("input"))
return element
}