bokeh.models.SingleIntervalTicker

Here are the examples of the python api bokeh.models.SingleIntervalTicker taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 Source : timeline_visualizer.py
with Apache License 2.0
from xldrx

    def _generate_device_plot(self, device_events):
        data_source = self._convert_events_to_datasource(device_events['events'])
        n_rows = device_events['n_rows']
        if n_rows == 0:
            n_rows = 1
        elif n_rows == 1:
            n_rows = 2
        name = device_events['name']

        plot = figure(
            title="{}".format(name),
            plot_height=20 * n_rows + 60,
            plot_width=1200,
            tools=self._tools,
            sizing_mode='scale_width',
            active_scroll='xwheel_zoom'
        )
        plot.hbar(
            left='start',
            right='end',
            y='height',
            color='color',
            height=0.85,
            source=data_source,
            hover_fill_alpha=0.5,
            line_join='round',
            line_cap='round',
            hover_line_color='red'
        )

        plot.x_range = Range1d(0, self._iteration_time, bounds="auto")
        plot.y_range = Range1d(0, n_rows)

        plot.yaxis.visible = False
        plot.ygrid.ticker = SingleIntervalTicker(interval=1)
        plot.ygrid.grid_line_color = None
        plot.ygrid.band_fill_alpha = 0.1
        plot.ygrid.band_fill_color = "gray"

        button = Button(label=" Sync", width=20, button_type='primary', disabled=True)
        button.css_classes = ['xl-hidden']
        button.js_on_click(
            CustomJS(
                args={
                    'me': plot,
                },
                code=self._js_update_ranges
            )
        )

        plot.x_range.js_on_change(
            'start',
            CustomJS(
                args={
                    'button': button,
                },
                code=self._js_on_change_callback)
        )

        return plot, WidgetBox(button)

    @staticmethod