How to hide sidebar?

Hi guys,

If I try to hide/show the sidebar, how do I handle it? can bokeh directly manipulate or modify .css file? thanks for any clue.

2019-01-17_13-24-50.png

.py

uHelper.checkbox_group_1 = CheckboxGroup(labels=[""], \

active=, \

name = ‘’)

uHelper.checkbox_group_2 = CheckboxGroup(labels=[""], \

active=, \

name = ‘’)

uHelper.checkbox_group_3 = CheckboxGroup(labels=[""], \

active=, \

name = ‘’)

``

.html


.sidebarmenutoplayout {

background-color: white !important;

color: white;

}

.sidebarmenumiddlelayout:hover {

display: flex !important;

background-color: black !important;

color: white;

width: 200px !important;

height: 850px !important;

}

.sidebarmenumiddlelayout:focus {

display: flex !important;

background-color: black !important;

color: white;

width: 200px !important;

height: 850px !important;

}

.sidebarmenumiddlelayout:active {

display: flex !important;

background-color: black !important;

color: white;

width: 200px !important;

height: 850px !important;

}

.sidebarmenumiddlelayout {

display: none;

background-color: white !important;

color: white;

width: 200px !important;

height: 850px !important;

}

.menulayout:hover {

background-color: black !important;

display: block;

color: white;

text-align: initial;

width: 200px !important;

}

.menulayout:active {

background-color: black !important;

display: block;

color: white;

text-align: initial;

width: 200px !important;

}

.menulayout:focus {

background-color: black !important;

display: block;

color: white;

text-align: initial;

width: 200px !important;

}

.menulayout {

background-color: white !important;

display: block;

color: white;

text-align: initial;

width: 200px !important;

}

.sidebarlayout:hover {

text-align: left;

background-color: black;

width: 200px !important;

position: inherit !important;

}

.sidebarlayout:focus {

text-align: left;

background-color: black;

width: 200px !important;

position: inherit !important;

}

.sidebarlayout:active {

text-align: left;

background-color: black;

width: 200px !important;

position: inherit !important;

}

.sidebarlayout {

text-align: left;

background-color: white;

width: 200px !important;

position: inherit !important;

}

``

uHelper.menu_column_1_layout.css_classes = [“sidebarmenucombxlayout”]

uHelper.well_selection_layout = column(uHelper.m_well_selection, uHelper.checkbox_group_1)

uHelper.well_connection_layout = column(uHelper.m_well_connection, uHelper.checkbox_group_2)

uHelper.well_conn_phase_layout = column(uHelper.m_well_conn_phase, uHelper.checkbox_group_3)

uHelper.menu_column_2_layout = column(uHelper.well_selection_layout, uHelper.well_connection_layout, uHelper.well_conn_phase_layout)

uHelper.menu_column_2_layout.css_classes = [“sidebarmenucheckbxlayout”]

uHelper.menu_middle_layout = layout(column(uHelper.menu_column_1_layout, uHelper.menu_column_2_layout))

uHelper.menu_middle_layout.css_classes = [“sidebarmenumiddlelayout”]

uHelper.menu_top_layout = layout(column(uHelper.spacer_1, uHelper.version))

uHelper.menu_top_layout.css_classes = [“sidebarmenutoplayout”]

uHelper.menu_bottom_layout = layout(column(uHelper.spacer_2))

uHelper.menu_bottom_layout.css_classes = [“sidebarmenubottomlayout”]

``

Hi,

Not sure about doing things from the python side directly, but with a CustomJS callback you should be able to manipulate the sidebar. Could do something like swap out `sidebar-open` class for `sidebar-closed` class and define settings for those in your style sheet.

Hope that helps,

Matt

You can add a a custom css class to give to any bokeh model, something like that:

.hidden {

display:none;

}

or

.hidden{

visibility:hidden;

}

In a JS callback (of a button for example) you can select whichever element you want (if you have given them other custom css classnames use document.getElementbyClassName to get them easily) and then you can add or remove “hidden” from the className of the element