Remove hkl arrows

This commit is contained in:
usov_i 2023-02-15 14:42:37 +01:00
parent f0488f5648
commit 4dd7644596
2 changed files with 0 additions and 47 deletions

View File

@ -7,7 +7,6 @@ import tempfile
import numpy as np import numpy as np
from bokeh.layouts import column, row from bokeh.layouts import column, row
from bokeh.models import ( from bokeh.models import (
Arrow,
Button, Button,
CheckboxGroup, CheckboxGroup,
ColumnDataSource, ColumnDataSource,
@ -16,7 +15,6 @@ from bokeh.models import (
Legend, Legend,
LegendItem, LegendItem,
MultiSelect, MultiSelect,
NormalHead,
NumericInput, NumericInput,
Panel, Panel,
RadioGroup, RadioGroup,
@ -423,17 +421,6 @@ def create():
grid_source.data.update(xs=xs, ys=ys) grid_source.data.update(xs=xs, ys=ys)
minor_grid_source.data.update(xs=xs_minor, ys=ys_minor) minor_grid_source.data.update(xs=xs_minor, ys=ys_minor)
arrow1.visible = True
arrow1.x_end = x_c[0]
arrow1.y_end = x_c[1]
arrow2.visible = True
arrow2.x_end = y_c[0]
arrow2.y_end = y_c[1]
kvect_source.data.update(
x=[x_c[0] / 2, y_c[0] / 2 - 0.1], y=[x_c[1] - 0.1, y_c[1] / 2], text=["h", "k"]
)
def _update_slice(): def _update_slice():
cut_tol = hkl_delta.value cut_tol = hkl_delta.value
cut_or = hkl_cut.value cut_or = hkl_cut.value
@ -548,14 +535,6 @@ def create():
source=scatter_source, marker="m", size="s", fill_color="c", line_color="c" source=scatter_source, marker="m", size="s", fill_color="c", line_color="c"
) )
arrow1 = Arrow(x_start=0, y_start=0, x_end=0, y_end=0, end=NormalHead(size=10), visible=False)
plot.add_layout(arrow1)
arrow2 = Arrow(x_start=0, y_start=0, x_end=0, y_end=0, end=NormalHead(size=10), visible=False)
plot.add_layout(arrow2)
kvect_source = ColumnDataSource(dict(x=[], y=[], text=[]))
plot.text(source=kvect_source)
plot.add_layout(Legend(items=[], location="top_left", click_policy="hide")) plot.add_layout(Legend(items=[], location="top_left", click_policy="hide"))
hkl_div = Div(text="HKL:", margin=(5, 5, 0, 5)) hkl_div = Div(text="HKL:", margin=(5, 5, 0, 5))

View File

@ -5,7 +5,6 @@ import os
import numpy as np import numpy as np
from bokeh.layouts import column, row from bokeh.layouts import column, row
from bokeh.models import ( from bokeh.models import (
Arrow,
Button, Button,
CheckboxGroup, CheckboxGroup,
ColumnDataSource, ColumnDataSource,
@ -13,11 +12,9 @@ from bokeh.models import (
FileInput, FileInput,
Legend, Legend,
LegendItem, LegendItem,
NormalHead,
NumericInput, NumericInput,
RadioGroup, RadioGroup,
Range1d, Range1d,
Spacer,
Spinner, Spinner,
TextAreaInput, TextAreaInput,
TextInput, TextInput,
@ -210,17 +207,6 @@ class PlotHKL:
grid_source.data.update(xs=xs, ys=ys) grid_source.data.update(xs=xs, ys=ys)
minor_grid_source.data.update(xs=xs_minor, ys=ys_minor) minor_grid_source.data.update(xs=xs_minor, ys=ys_minor)
arrow1.visible = True
arrow1.x_end = x_c[0]
arrow1.y_end = x_c[1]
arrow2.visible = True
arrow2.x_end = y_c[0]
arrow2.y_end = y_c[1]
kvect_source.data.update(
x=[x_c[0] / 2, y_c[0] / 2 - 0.1], y=[x_c[1] - 0.1, y_c[1] / 2], text=["h", "k"]
)
# Prepare hkl/mhkl data # Prepare hkl/mhkl data
hkl_coord2 = [] hkl_coord2 = []
for j, fname in enumerate(upload_hkl_fi.filename): for j, fname in enumerate(upload_hkl_fi.filename):
@ -377,18 +363,6 @@ class PlotHKL:
plot.yaxis.visible = False plot.yaxis.visible = False
plot.ygrid.visible = False plot.ygrid.visible = False
arrow1 = Arrow(
x_start=0, y_start=0, x_end=0, y_end=0, end=NormalHead(size=10), visible=False
)
plot.add_layout(arrow1)
arrow2 = Arrow(
x_start=0, y_start=0, x_end=0, y_end=0, end=NormalHead(size=10), visible=False
)
plot.add_layout(arrow2)
kvect_source = ColumnDataSource(dict(x=[], y=[], text=[]))
plot.text(source=kvect_source)
grid_source = ColumnDataSource(dict(xs=[], ys=[])) grid_source = ColumnDataSource(dict(xs=[], ys=[]))
plot.multi_line(source=grid_source, line_color="gray") plot.multi_line(source=grid_source, line_color="gray")