diff --git a/bokeh/models/annotations.py b/bokeh/models/annotations.py index ae7298ceebb..9fc5a832a9c 100644 --- a/bokeh/models/annotations.py +++ b/bokeh/models/annotations.py @@ -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. """) diff --git a/bokehjs/src/lib/core/property_mixins.ts b/bokehjs/src/lib/core/property_mixins.ts index bc40cf02901..b067c232ed5 100644 --- a/bokehjs/src/lib/core/property_mixins.ts +++ b/bokehjs/src/lib/core/property_mixins.ts @@ -156,10 +156,10 @@ export type LineVector = { line_color: p.VectorSpec line_alpha: p.VectorSpec line_width: p.VectorSpec - line_join: p.ScalarSpec - line_cap: p.ScalarSpec - line_dash: p.ScalarSpec - line_dash_offset: p.ScalarSpec + line_join: p.Property + line_cap: p.Property + line_dash: p.Property + line_dash_offset: p.Property } export type FillVector = { @@ -173,53 +173,53 @@ export type HatchVector = { hatch_scale: p.VectorSpec hatch_pattern: p.VectorSpec hatch_weight: p.VectorSpec - hatch_extra: p.VectorSpec + hatch_extra: p.Property } export type TextVector = { text_color: p.VectorSpec text_alpha: p.VectorSpec - text_font: p.ScalarSpec + text_font: p.Property text_font_size: p.VectorSpec - text_font_style: p.ScalarSpec - text_align: p.ScalarSpec - text_baseline: p.ScalarSpec - text_line_height: p.ScalarSpec + text_font_style: p.Property + text_align: p.Property + text_baseline: p.Property + text_line_height: p.Property } export const LineVector: p.DefineOf = { - 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 = { - 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 = { - 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 = { - 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. diff --git a/bokehjs/test/unit/core/visuals.ts b/bokehjs/test/unit/core/visuals.ts index c3ebfeb615b..89f500fd3f9 100644 --- a/bokehjs/test/unit/core/visuals.ts +++ b/bokehjs/test/unit/core/visuals.ts @@ -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) @@ -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) @@ -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)