from ipywidgets import widgets,interact
vertex_attribute = [0, 1, 1, 0]
plot = k3d.plot()
mesh = k3d.mesh(vertices, indices, attribute=vertex_attribute, color_map=k3d.basic_color_maps.CoolWarm, color_range=[0.0, 1.0])
plot += mesh
basic_color_maps = [attr for attr in dir(k3d.basic_color_maps) if not attr.startswith('__')]
paraview_color_maps = [attr for attr in dir(k3d.paraview_color_maps) if not attr.startswith('__')]
matplotlib_color_maps = [attr for attr in dir(k3d.matplotlib_color_maps) if not attr.startswith('__')]
@interact(x=widgets.Dropdown(options=basic_color_maps, value=basic_color_maps[0], description='Basic ColorMap:'))
def g(x):
mesh.color_map = getattr(k3d.basic_color_maps, x)
@interact(x=widgets.Dropdown(options=paraview_color_maps, value=paraview_color_maps[0], description='ParaView ColorMap:'))
def g(x):
mesh.color_map = getattr(k3d.paraview_color_maps, x)
@interact(x=widgets.Dropdown(options=matplotlib_color_maps, value=matplotlib_color_maps[0], description='MatplolLib ColorMap:'))
def g(x):
mesh.color_map = getattr(k3d.matplotlib_color_maps, x)
plot.display()