man-group / dtale

Visualizer for pandas data structures
http://alphatechadmin.pythonanywhere.com
GNU Lesser General Public License v2.1
4.78k stars 405 forks source link

How to not show all the menu and sidebar #796

Closed hhlim333 closed 1 year ago

hhlim333 commented 1 year ago

Hi,

Can I delete all the menu and side bar when showing the dataframe?

Just show the dataframe and not display ribbon-menu.

Thank you

aschonfeld commented 1 year ago

I can certainly add a configuration parameter to hide the ribbon menu. Just curious what you mean by "side bar"? Happy to add a parameter to hide that as well

hhlim333 commented 1 year ago

Thank you for your quick response.

螢幕截圖 2023-09-08 13 28 17 螢幕截圖 2023-09-08 13 28 21

Thank you for your help

aschonfeld commented 1 year ago

Ok, so you want the main menu and column menus hidden as well. I can add flags for those as well

hhlim333 commented 1 year ago

Am I correct ?

It seems not working.

螢幕截圖 2023-09-10 15 27 43

Thank you for your help

aschonfeld commented 1 year ago

I have only merged this code change, I haven't released a new version of the package yet. I will update you once that is available

aschonfeld commented 1 year ago

@hhlim333 so I just published v3.5.0 which includes this functionality. You can hide the ribbon & side menus by specifying hide_header_menu, hide_main_menu and/or hide_column_menus when calling dtale.show (would only affect this piece of data):

import numpy as np
import pandas as pd
import dtale

dtale.show(pd.DataFrame([1,2,3,4,5]), hide_header_menu=True, hide_main_menu=True, hide_column_menus=True)

Another would be using global configuration. Following this documentation you can add the following to the [app] section for it to be applied to every dataframe you load into D-Tale without specifying parameters in your code. This would be applied to every piece of data you load into D-Tale:

hide_header_menu = True
hide_main_menu = True
hide_column_menus = True

And lastly you can lock the header menu for all data loaded into D-Tale thru code using the following:

import numpy as np
import pandas as pd
import dtale
import dtale.global_state as global_state

global_state.set_app_settings(dict(hide_header_menu=True, hide_main_menu=True, hide_column_menus=True))

dtale.show(pd.DataFrame([1,2,3,4,5]))

Let me know if you have any issues.