Comments (4)
Try this:
from random import randint
import numpy as np
from bokeh.layouts import column
from bokeh.models import Button, Dialog, OpenDialog
from bokeh.io import curdoc, output_notebook
from bokeh.models import ColumnDataSource, InlineStyleSheet
from bokeh.models.widgets import DataTable, DateFormatter, TableColumn, Div
from bokeh.plotting import show
show_Dialog = Button(label="Show Dialog")
style = InlineStyleSheet(css="""
:host(.custom_button_1) {
z-index: 200;
}
""")
dialog = Dialog(
title="test",
content=Div(text="test"),
stylesheets=[style],
css_classes=['custom_button_1'],
)
show_Dialog.js_on_click(OpenDialog(dialog=dialog))
data = dict(
dates=[date(2014, 3, i+1) for i in range(10)],
downloads=[randint(0, 100) for i in range(10)],
)
source = ColumnDataSource(data)
columns = [
TableColumn(field="dates", title="Date", formatter=DateFormatter()),
TableColumn(field="downloads", title="Downloads"),
]
data_table = DataTable(source=source, columns=columns, width=400, height=280)
layout = column([
show_Dialog,
data_table
])
curdoc().add_root(layout)
Also make sure to import InlineStyleSheet
from bokeh.
This
style = InlineStyleSheet(css="""
:host(.custom_button_1) {
z-index: 200;
}
""")
will work in some cases due to CSS specificity rules, but it will also break window stacking (z-index
is managed by Dialog
).
from bokeh.
This
style = InlineStyleSheet(css=""" :host(.custom_button_1) { z-index: 200; } """)will work in some cases due to CSS specificity rules, but it will also break window stacking (
z-index
is managed byDialog
).
Could you explain further? Sorry, I'm very new to coding and thought it's fine because you can close that window to view anything below it.
from bokeh.
Could you explain further? Sorry, I'm very new to coding and thought it's fine because you can close that window to view anything below it.
Dialog
sets z-index
dynamically, so that it can manage stacking of all dialogs on the page. If you set a fixed z-index
value in a stylesheet, then given the current design, that stylesheet takes precedence over what Dialog
sets and thus all dialogs will be fixed at a single z-index
and their stacking will be defined by the order of rendering. This will work for one dialog and in some cases for multiple, but not in general.
from bokeh.
Related Issues (20)
- Taptool Still Not Toggling Pie Chart Wedges [BUG] HOT 1
- Make RGB serialization more robust HOT 8
- [BUG] Glyphs should correctly use configured ranges HOT 6
- [BUG] StringFormatter `nan_format` seems broken HOT 2
- [BUG] MathText support fails in VSCode Jupyter Notebook HOT 2
- [BUG] LaTeX interpretation error in title HOT 2
- Update environment variables section in dev docs
- [FEATURE] Box zoom tool - enable dynamic dimensions zooming
- Add WebGL implementation for Ngon glyph
- JS unit tester issues
- [BUG] Taptool (Select and Unselect) behaves unexpectedly when renderer.glyph dataset is changed by widgets
- [BUG] Custom ColumnDataSource selections seem to be overridden by some mechanism in DataTable HOT 1
- [FEATURE] Adding decoration to MultiLine HOT 5
- [BUG] Tooltip Doesn't Display Multiple Fields with Swatch HOT 2
- [BUG] Dynamically Adjusting Spacing in Panel MultiChoice Widget HOT 5
- [BUG] Custom hover tooltip on image plot shows all the image data. HOT 2
- [BUG] Clearing selection with ESC only works on first selection tool
- Clean up Bokeh events API
- Mouse enter/leave events occurring on any tap
- Deprecation warning from pytest 8.3.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bokeh.