Esempio n. 1
0
def plot():
    output_file('templates/plot_page.html')
    plot = make_plot()
    plot.x_scale = LinearScale()
    plot.y_scale = LinearScale()
    js_resources = INLINE.render_js()
    css_resources = INLINE.render_css()
    save(plot)
    return render_template('plot_page.html')
Esempio n. 2
0
def test__check_compatible_scale_and_ranges_compat_numeric():
    plot = Plot(x_scale=LinearScale(), x_range=Range1d())
    check = plot._check_compatible_scale_and_ranges()
    assert check == []

    plot = Plot(y_scale=LogScale(), y_range=DataRange1d())
    check = plot._check_compatible_scale_and_ranges()
    assert check == []
Esempio n. 3
0
def test__check_compatible_scale_and_ranges_incompat_numeric_scale_and_factor_range(
):
    plot = Plot(x_scale=LinearScale(), x_range=FactorRange())
    check = plot._check_compatible_scale_and_ranges()
    assert check != []
Esempio n. 4
0
def test_plot_raises_error_if_x_mapper_type_and_x_scale_are_set():
    with pytest.raises(ValueError):
        Plot(x_mapper_type="linear", x_scale=LinearScale())