def refresh_user_view():
    """
    periodically called function that updates data with respect to the current user view, if the user view has changed.
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(
        source_view.data, plot)
    if user_view_has_changed:
        source_view.data = my_bokeh_utils.get_user_view(plot)
        update_quiver_data()
        update_data(None, None, None)
def refresh_quiver():
    """
    periodically called function that updates data with respect to the current user view, if the user view has changed.
    :return:
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(source_view.data, plot_field)
    if user_view_has_changed:
        u_str = u_input.value
        v_str = v_input.value
        update_quiver_data(u_str, v_str)
        source_view.data = my_bokeh_utils.get_user_view(plot_field)
def check_parameters(max_iterations):
    """
    checks for a change in the user input parameters that affect the computation of the mandelbrot set
    :param max_iterations: maximum iteration number
    :return: bool that states if any relevant parameter has been changed
    """

    user_view_has_changed = my_bokeh_utils.check_user_view(source_view.data, plot)
    parameters_have_changed = user_view_has_changed or \
                              (source_mandel_raw.data['max_iter'][0] != max_iterations)
    return parameters_have_changed
Beispiel #4
0
def check_parameters(max_iterations):
    """
    checks for a change in the user input parameters that affect the computation of the mandelbrot set
    :param max_iterations: maximum iteration number
    :return: bool that states if any relevant parameter has been changed
    """

    user_view_has_changed = my_bokeh_utils.check_user_view(source_view.data, plot)
    parameters_have_changed = user_view_has_changed or \
                              (source_mandel_raw.data['max_iter'][0] != max_iterations)
    return parameters_have_changed
def refresh_quiver():
    """
    periodically called function that updates data with respect to the current user view, if the user view has changed.
    :return:
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(
        source_view.data, plot_field)
    if user_view_has_changed:
        u_str = u_input.value
        v_str = v_input.value
        update_quiver_data(u_str, v_str)
        source_view.data = my_bokeh_utils.get_user_view(plot_field)
def refresh_user_view():
    """
    periodically called function that updates data with respect to the current user view, if the user view has changed.
    :return:
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(source_view.data, plot)
    if user_view_has_changed:
        u_str = u_input.value
        v_str = v_input.value
        x_mark = source_initialvalue.data['x0'][0]
        y_mark = source_initialvalue.data['y0'][0]
        update_quiver_data(u_str, v_str)
        update_streamline_data(u_str, v_str, x_mark, y_mark)
        source_view.data = my_bokeh_utils.get_user_view(plot)
        interactor.update_to_user_view()
Beispiel #7
0
def refresh_user_view():
    """
    periodically called function that updates data with respect to the current user view, if the user view has changed.
    :return:
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(
        source_view.data, plot)
    if user_view_has_changed:
        u_str = u_input.value
        v_str = v_input.value
        x_mark = source_initialvalue.data['x0'][0]
        y_mark = source_initialvalue.data['y0'][0]
        update_quiver_data(u_str, v_str)
        update_streamline_data(u_str, v_str, x_mark, y_mark)
        source_view.data = my_bokeh_utils.get_user_view(plot)
        interactor.update_to_user_view()
Beispiel #8
0
def refresh_contour():
    """
    periodically called function that updates data with respect to the current user view, if the user view has changed.
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(source_view.data, plot)
    if user_view_has_changed:
        f, _ = my_bokeh_utils.string_to_function_parser(f_input.value, ['x', 'y'])
        g, _ = my_bokeh_utils.string_to_function_parser(g_input.value, ['x', 'y'])

        if len(source_mark.data['x']) > 0:  # has any point been marked?
            compute_click_data()

        contour_f.compute_contour_data(f)
        contour_g.compute_contour_data(g, [0])
        interactor.update_to_user_view()
        source_view.data = my_bokeh_utils.get_user_view(plot)
def automatic_update():
    """
    Function that is regularly called by the periodic callback. Updates the plots to the current user view.
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(source_view.data, plot)
    if user_view_has_changed:

        source_view.data = my_bokeh_utils.get_user_view(plot)

        # read control variables
        N = int(round(degree.value))  # Get the current slider values
        f = source_f.data['f'][0]
        t_start = source_periodicity.data['t_start'][0]
        t_end = source_periodicity.data['t_end'][0]

        print "updating plot"
        update_plot(f, N, t_start, t_end)
Beispiel #10
0
def automatic_update():
    """
    Function that is regularly called by the periodic callback. Updates the plots to the current user view.
    """
    user_view_has_changed = my_bokeh_utils.check_user_view(
        source_view.data, plot)
    if user_view_has_changed:

        source_view.data = my_bokeh_utils.get_user_view(plot)

        # read control variables
        N = int(round(degree.value))  # Get the current slider values
        f = source_f.data['f'][0]
        t_start = source_periodicity.data['t_start'][0]
        t_end = source_periodicity.data['t_end'][0]

        print "updating plot"
        update_plot(f, N, t_start, t_end)