Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tree_maker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ABP Computing
ABP Computing Sandbox
tree_maker
Commits
dacaccf3
Commit
dacaccf3
authored
3 years ago
by
Hamish Graham
Browse files
Options
Downloads
Patches
Plain Diff
updated pandas_bokeh.py
parent
027a8d67
No related branches found
No related tags found
No related merge requests found
Pipeline
#2973503
failed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/hamish_example/pandas_bokeh.py
+21
-12
21 additions, 12 deletions
examples/hamish_example/pandas_bokeh.py
with
21 additions
and
12 deletions
examples/hamish_example/pandas_bokeh.py
+
21
−
12
View file @
dacaccf3
...
@@ -3,7 +3,7 @@ import tree_maker as tm
...
@@ -3,7 +3,7 @@ import tree_maker as tm
from
pandas
import
DataFrame
from
pandas
import
DataFrame
from
bokeh.layouts
import
column
from
bokeh.layouts
import
column
from
bokeh.models
import
ColumnDataSource
,
Slider
,
WheelZoomTool
,
BoxZoomTool
,
Button
from
bokeh.models
import
ColumnDataSource
,
Slider
,
WheelZoomTool
,
BoxZoomTool
,
Button
,
PanTool
from
bokeh.plotting
import
figure
from
bokeh.plotting
import
figure
from
bokeh.themes
import
Theme
from
bokeh.themes
import
Theme
from
bokeh.io
import
show
,
output_notebook
from
bokeh.io
import
show
,
output_notebook
...
@@ -12,7 +12,10 @@ output_notebook()
...
@@ -12,7 +12,10 @@ output_notebook()
#root = tm.tree_from_json(filename='/home/HPC/sterbini/DA_study_example/study_000/tree.json')
#root = tm.tree_from_json(filename='/home/HPC/sterbini/DA_study_example/study_000/tree.json')
def
bkapp
(
doc
):
def
bkapp
(
doc
,
root
,
last_key
,
choose_color
):
"""
This creates an interactive plot showing a tree of jobs in a
'
flower
'
shape.
"""
global
my_df
global
my_df
global
source
global
source
...
@@ -29,12 +32,6 @@ def bkapp(doc):
...
@@ -29,12 +32,6 @@ def bkapp(doc):
del
my_df
[
'
handle
'
]
del
my_df
[
'
handle
'
]
source
=
ColumnDataSource
(
data
=
my_df
)
plot
=
figure
(
plot_width
=
400
,
plot_height
=
400
,
tools
=
"
lasso_select
"
,
title
=
"
Select Here
"
)
plot
.
circle
(
'
x
'
,
'
y
'
,
source
=
source
,
alpha
=
0.6
,
color
=
'
color
'
)
plot
.
add_tools
(
BoxZoomTool
())
def
callback
(
attr
,
index_list
,
_
):
def
callback
(
attr
,
index_list
,
_
):
global
my_df
global
my_df
global
my_df_selected
global
my_df_selected
...
@@ -43,13 +40,25 @@ def bkapp(doc):
...
@@ -43,13 +40,25 @@ def bkapp(doc):
def
dummyfunction
():
def
dummyfunction
():
global
my_df
global
my_df
my_df
=
ps
.
update
(
my_df
,
'
completed
'
,
'
green
'
)
my_df
=
ps
.
update
(
my_df
,
last_key
,
choose_color
)
dummyfunction
()
source
=
ColumnDataSource
(
data
=
my_df
)
TOOLTIPS
=
[
(
'
index
'
,
"
@index
"
),
(
'
status
'
,
"
@status
"
),
(
'
path
'
,
"
@path
"
)
]
plot
=
figure
(
plot_width
=
400
,
plot_height
=
400
,
tools
=
"
lasso_select
"
,
title
=
"
Select Here
"
,
tooltips
=
TOOLTIPS
)
plot
.
circle
(
'
x
'
,
'
y
'
,
source
=
source
,
alpha
=
0.6
,
color
=
'
color
'
)
plot
.
add_tools
(
BoxZoomTool
(),
WheelZoomTool
(),
PanTool
())
source
.
selected
.
on_change
(
'
indices
'
,
callback
)
source
.
selected
.
on_change
(
'
indices
'
,
callback
)
button
=
Button
(
label
=
"
Update
"
,
button_type
=
"
success
"
)
button
=
Button
(
label
=
"
Update
"
,
button_type
=
"
success
"
)
button
.
on_click
(
dummyfunction
)
button
.
on_click
(
dummyfunction
)
doc
.
add_root
(
column
(
plot
,
button
))
doc
.
add_root
(
column
(
plot
,
button
))
show
(
bkapp
,
notebook_url
=
'
http://localhost:8102
'
,
port
=
8202
)
# notebook_url="http://localhost:8888"
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment