Skip to content

Commit

Permalink
Forward merge from 2.1.1 (#10227)
Browse files Browse the repository at this point in the history
* release notes for 2.1.1

* Fix bokehjs' property mixins to match bokeh (#10192)

* Fix bokehjs' property mixins to match bokeh

* Change ColorBar.bar_line_* to scalar

* Relativize imports of auto-generated modules (#10188)

Co-authored-by: Mateusz Paprocki <mattpap@gmail.com>
  • Loading branch information
bryevdv and mattpap committed Jun 24, 2020
1 parent 57da24a commit 1c8ca2b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 38 deletions.
2 changes: 1 addition & 1 deletion bokeh/models/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ class ColorBar(Annotation):
main plot area.
""")

bar_props = Include(LineProps, help="""
bar_props = Include(ScalarLineProps, help="""
The %s for the color scale bar outline.
""")

Expand Down
3 changes: 2 additions & 1 deletion bokehjs/src/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export function default_transformers(options: ts.CompilerOptions): ts.CustomTran
const module_file = join(base, module_path)
if (ts.sys.fileExists(module_file) ||
ts.sys.fileExists(module_file + ".ts") ||
ts.sys.fileExists(join(module_file, "index.ts"))) {
ts.sys.fileExists(join(module_file, "index.ts")) ||
options.outDir != null && ts.sys.fileExists(join(options.outDir, module_path + ".js"))) {
const rel_path = normalize(relative(dirname(file), module_file))
return rel_path.startsWith(".") ? rel_path : `./${rel_path}`
}
Expand Down
66 changes: 33 additions & 33 deletions bokehjs/src/lib/core/property_mixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ export type LineVector = {
line_color: p.VectorSpec<Color | null>
line_alpha: p.VectorSpec<number>
line_width: p.VectorSpec<number>
line_join: p.ScalarSpec<LineJoin>
line_cap: p.ScalarSpec<LineCap>
line_dash: p.ScalarSpec<number[]>
line_dash_offset: p.ScalarSpec<number>
line_join: p.Property<LineJoin>
line_cap: p.Property<LineCap>
line_dash: p.Property<number[]>
line_dash_offset: p.Property<number>
}

export type FillVector = {
Expand All @@ -173,53 +173,53 @@ export type HatchVector = {
hatch_scale: p.VectorSpec<number>
hatch_pattern: p.VectorSpec<HatchPattern | null>
hatch_weight: p.VectorSpec<number>
hatch_extra: p.VectorSpec<HatchExtra>
hatch_extra: p.Property<HatchExtra>
}

export type TextVector = {
text_color: p.VectorSpec<Color | null>
text_alpha: p.VectorSpec<number>
text_font: p.ScalarSpec<string>
text_font: p.Property<string>
text_font_size: p.VectorSpec<string>
text_font_style: p.ScalarSpec<FontStyle>
text_align: p.ScalarSpec<TextAlign>
text_baseline: p.ScalarSpec<TextBaseline>
text_line_height: p.ScalarSpec<number>
text_font_style: p.Property<FontStyle>
text_align: p.Property<TextAlign>
text_baseline: p.Property<TextBaseline>
text_line_height: p.Property<number>
}

export const LineVector: p.DefineOf<LineVector> = {
line_color: [ p.ColorSpec, "black" ],
line_alpha: [ p.NumberSpec, 1.0 ],
line_width: [ p.NumberSpec, 1 ],
line_join: [ p.LineJoinScalar, "bevel" ],
line_cap: [ p.LineCapScalar, "butt" ],
line_dash: [ p.ArrayScalar, [] ],
line_dash_offset: [ p.NumberScalar, 0 ],
line_color: [ p.ColorSpec, "black" ],
line_alpha: [ p.NumberSpec, 1.0 ],
line_width: [ p.NumberSpec, 1 ],
line_join: [ p.LineJoin, "bevel" ],
line_cap: [ p.LineCap, "butt" ],
line_dash: [ p.Array, [] ],
line_dash_offset: [ p.Number, 0 ],
}

export const FillVector: p.DefineOf<FillVector> = {
fill_color: [ p.ColorSpec, "gray" ],
fill_alpha: [ p.NumberSpec, 1.0 ],
fill_color: [ p.ColorSpec, "gray" ],
fill_alpha: [ p.NumberSpec, 1.0 ],
}

export const HatchVector: p.DefineOf<HatchVector> = {
hatch_color: [ p.ColorSpec, "black" ],
hatch_alpha: [ p.NumberSpec, 1.0 ],
hatch_scale: [ p.NumberSpec, 12.0 ],
hatch_pattern: [ p.NullStringSpec, null ],
hatch_weight: [ p.NumberSpec, 1.0 ],
hatch_extra: [ p.AnyScalar, {} ],
hatch_color: [ p.ColorSpec, "black" ],
hatch_alpha: [ p.NumberSpec, 1.0 ],
hatch_scale: [ p.NumberSpec, 12.0 ],
hatch_pattern: [ p.NullStringSpec, null ],
hatch_weight: [ p.NumberSpec, 1.0 ],
hatch_extra: [ p.Any, {} ],
}

export const TextVector: p.DefineOf<TextVector> = {
text_color: [ p.ColorSpec, "#444444" ],
text_alpha: [ p.NumberSpec, 1.0 ],
text_font: [ p.Font, "helvetica" ],
text_font_size: [ p.FontSizeSpec, "16px" ],
text_font_style: [ p.FontStyleScalar, "normal" ],
text_align: [ p.TextAlignScalar, "left" ],
text_baseline: [ p.TextBaselineScalar, "bottom" ],
text_line_height: [ p.NumberScalar, 1.2 ],
text_color: [ p.ColorSpec, "#444444" ],
text_alpha: [ p.NumberSpec, 1.0 ],
text_font: [ p.Font, "helvetica" ],
text_font_size: [ p.FontSizeSpec, "16px" ],
text_font_style: [ p.FontStyle, "normal" ],
text_align: [ p.TextAlign, "left" ],
text_baseline: [ p.TextBaseline, "bottom" ],
text_line_height: [ p.Number, 1.2 ],
}

// Common property mixins used in models. This duplication is currently unavoidable.
Expand Down
6 changes: 3 additions & 3 deletions bokehjs/test/unit/core/visuals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Fill", () => {
it(`should set canvas context ${attr} value from ${spec} spec value`, () =>{
const ctx = {} as any
const attrs = {} as any
attrs[spec] = {value}
attrs[spec] = value
const model = new Circle(attrs)
const fill = new Fill(model)
fill.set_value(ctx)
Expand Down Expand Up @@ -69,7 +69,7 @@ describe("Line", () => {
ctx.setLineDash = function(x: number) { ctx.lineDash = x }
ctx.setLineDashOffset = function(x: number) { ctx.lineDashOffset = x }
const attrs = {line_dash: [1, 2]} as any
attrs[spec] = {value}
attrs[spec] = value
const model = new Circle(attrs)
const line = new Line(model)
line.set_value(ctx)
Expand Down Expand Up @@ -120,7 +120,7 @@ describe("Text", () => {
it(`should set canvas context ${attr} value from ${spec} spec value`, () =>{
const ctx = {} as any
const attrs = {text_font: 'times', text_font_size: "16px", text_font_style: "bold"} as any
attrs[spec] = {value}
attrs[spec] = value
const model = new text_glyph.Text(attrs)
const text = new Text(model)
text.set_value(ctx)
Expand Down
13 changes: 13 additions & 0 deletions sphinx/source/docs/releases/2.1.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _release-2-1-1:

2.1.1
=====

Bokeh Version ``2.1.1`` (June 2020) is a patch-release that fixes some bugs:

* Can't resolve styles when importing BokehJS (:bokeh-issue:`10172`)
* Bokeh server fails to start correctly with random port (:bokeh-issue:`10175`)
* Some scalar properties seralizing incorrectly (:bokeh-issue:`10181`, :bokeh-issue:`10197`)
* Typed arrays not returned to Bokeh server as lists (:bokeh-issue:`10204`)

For full details see the :bokeh-tree:`CHANGELOG`.

0 comments on commit 1c8ca2b

Please sign in to comment.