{
const menuContainer = d3.create('div')
.attr('class', 'menu-container');
const carMenu = menuContainer.append('div');
const options = [
{ value: 'volvo', text: 'Volvo' },
{ value: 'saab', text: 'Saab' },
{ value: 'mercedes', text: 'Mercedes' },
{ value: 'audi', text: 'Audi' }
];
carMenu.call(
menu()
.id('car-menu')
.labelText('Car: ')
.options(options)
.on('change', (value) => {
console.log(`You selected: ${value}`);
})
);
return menuContainer.node();
}