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

Document for configuring column format #577

Closed
hoangphucITJP opened this issue Sep 29, 2021 · 7 comments
Closed

Document for configuring column format #577

hoangphucITJP opened this issue Sep 29, 2021 · 7 comments

Comments

@hoangphucITJP
Copy link

As mentioned in:
#519 (comment)

I see that we can pass column formating this way:

global_state.set_settings(d._data_id, {'columnFormats': formatting})

But looking through all the available documents. I can't find any guide on how to use the columnFormats.
Please give me some hints. Or could it be that I miss something?

The cause that arises this issue is that I want to programmatically turn on the heatmap for the columns. Can you advise on how to do it

@aschonfeld
Copy link
Collaborator

aschonfeld commented Oct 2, 2021

@hoangphucITJP I will add documentation on the different settings options and let you know.

As for turning on the heatmap programmatically that does not exist right now. I did just add the ability to add "Range Highlights" programmatically though. So it shouldn't be hard for me to add the other highlighting options as well:

  • Heatmap
  • Highlight Dtypes
  • Highlight Missing
  • Highlight Outliers

I will try to include this in the next release and will let you know when it's ready

@aschonfeld
Copy link
Collaborator

@hoangphucITJP I have added the ability to set a background_mode when calling dtale.show in the the version I just released v1.58.1 and I have added the documentation you were looking for here. Hope this helps. Also, if you haven't already, please toss your ⭐ on the repo. Thanks 🙏

@hoangphucITJP
Copy link
Author

@hoangphucITJP I have added the ability to set a background_mode when calling dtale.show in the the version I just released v1.58.1 and I have added the documentation you were looking for here. Hope this helps. Also, if you haven't already, please toss your star on the repo. Thanks pray

Cool! Thanks for your effort 👍

@hoangphucITJP
Copy link
Author

hoangphucITJP commented Oct 3, 2021

Hi @aschonfeld . I pass background_mode='heatmap-col' into dtale.show but it does not work.
Maybe you miss passing the param here?

dtale/dtale/app.py

Lines 684 to 702 in cbb89ee

instance = startup(
startup_url,
data=data,
data_loader=data_loader,
name=name,
context_vars=context_vars,
ignore_duplicate=final_options["ignore_duplicate"],
allow_cell_edits=final_options["allow_cell_edits"],
inplace=final_options["inplace"],
drop_index=final_options["drop_index"],
precision=final_options["precision"],
show_columns=final_options["show_columns"],
hide_columns=final_options["hide_columns"],
column_formats=final_options["column_formats"],
nan_display=final_options["nan_display"],
sort=final_options["sort"],
locked=final_options["locked"],
range_highlights=final_options["range_highlights"],
)

@aschonfeld
Copy link
Collaborator

@hoangphucITJP sorry about that. Guess thats what I deserve for working too fast. Just released v1.58.2 which fixes this issue

@hoangphucITJP
Copy link
Author

  • heatmap-col: turn on heatmap for all numeric columns where the colors are determined by the range of values in the column

I used this, but the side-effect is it hides the non-numeric columns. Is that intended behavior, @aschonfeld ?

@aschonfeld
Copy link
Collaborator

aschonfeld commented Oct 16, 2021

So this is actually correct. "heatmap-col" and "heatmap-all" are the equivalent of using these buttons on the UI:
image

These two buttons hide any non-numeric columns, just as a way to make a prettier heatmap. If you would like to show non-numeric columns then you can add the suffix "-all" to the end of your background_mode. So essentially using "heatmap-all-all" or "heatmap-col-all" will give you what you want.

Adding the "-all" suffix is the equivalent of checking this checkbox in the UI:
image

If you would like to run the column-by-column heatmap which does not hide the non-numeric columns then you would have to set your background_mode to something like "heatmap-col-[column name]". The only drawback is that this only turns on a heatmap for one column.

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

2 participants