Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user-defined colormaps? #49

Open
gcerutti opened this issue Jun 3, 2021 · 2 comments
Open

Allow user-defined colormaps? #49

gcerutti opened this issue Jun 3, 2021 · 2 comments

Comments

@gcerutti
Copy link

gcerutti commented Jun 3, 2021

Hi,

First of all thank you for the awesome work on interfacing dash and VTK! Coming from the Python world, I was really impressed how smoothly I could move from my usual Python vtk tools to dash_vtk (thanks for that utils module ;) )

I was wondering if there could be an easy way for users to introduce their own custom colormap presets in a Representation, something I can imagine a lot of people would want to do at some point... (No matter how many options are available, I guess there will always be THAT crucial one missing...)

Would it be possible to go beyond the provided list, or is it a limitation that comes already from vtk.js? I'm thinking of a simple syntax reflecting the presets definition like this one:

view = dash_vtk.View(
    dash_vtk.GeometryRepresentation(
        children=[...],
        colorMapPreset= {
            'ColorSpace' : 'RGB',
            'Name' : 'gray',
            'RGBPoints' : [0, 0, 0, 0,
                           1, 1, 1, 1]
        }
    )
)

But there might be other options... I was expecting to have such an option through the mapper argument of the Representation, being used to do a mapper.setLookupTable, but I failed to find out how exactly the colormap information is passed to the mapper...

Thank you!

@jourdain
Copy link
Collaborator

jourdain commented Jun 6, 2021

Thanks for your kind words and we can surely support what you are suggesting. Do you want to make a PR to support either String(name) or Object(presetObj) and just skip the lookup if object here.

@quentco
Copy link

quentco commented Dec 9, 2021

Hi,
I am having the same issue. Having that option to input a custom colormap preset would be very useful.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants