8000 Redesign "materialization" of data specs by mattpap · Pull Request #10235 · bokeh/bokeh · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits 8000
Select commit Hold shift + click to select a range
7b2c9d5
Explicitly define glyph coordinates
mattpap Jun 14, 2020
49fbf63
Add default values
mattpap Jun 26, 2020
2511c9d
Don't check for nulls in MultiLine._index_data()
mattpap Jun 26, 2020
5f03f5a
Wrap only plain object default values
mattpap Jun 26, 2020
6d12421
Make data projection explicit
mattpap Jun 26, 2020
9196019
Clean up HexTile._set_data()
mattpap Jun 26, 2020
8f3a4e0
Add support for ragged arrays
mattpap Jun 26, 2020
f267b68
Encode dimension in coordinate specs
mattpap Jun 26, 2020
1be6b51
Explicit data materialization
mattpap Jun 27, 2020
35ec95a
Update incomplete unit tests
mattpap Jun 27, 2020
e2c650c
Update graph layout providers
mattpap Jul 5, 2020
b20dfb7
Fail safe when a column is missing
mattpap Jul 5, 2020
66549c6
Use NumberArray.set() in ImageURL
mattpap Jun 24, 2020
7f79d55
Update incomplete glyph tests
mattpap Jul 5, 2020
bc46b45
Assert number arrays in corner cases
mattpap Jul 5, 2020
84a3d68
Fix glyphs' defaults
mattpap Jul 5, 2020
54d988e
Explicit defaults in {V,H}Bar glyphs
mattpap Jul 5, 2020
361686b
Respect packed colors in webgl backend
mattpap Jul 5, 2020
3569c22
Unify handling of colors and alpha
mattpap Jul 6, 2020
e059b4a
Use CoordinateSeqSeqSeqSpec for multi polygons
mattpap Jul 6, 2020
709eed9
Make toStringTag static
mattpap Jul 6, 2020
fbf4f0c
Increase pixel allowance
mattpap Jul 7, 2020
5f1c988
Respect glyph protocol in graph renderer
mattpap Jul 8, 2020
81aa324
Ignore early glyph positional defaults
mattpap Jul 9, 2020
d19f28c
Mark export selenium tests as flaky
mattpap Jul 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use CoordinateSeqSeqSeqSpec for multi polygons
  • Loading branch information
mattpap committed Jul 8, 2020
commit e059b4ad78a1d936b622fb50a9f12dfab3878c13
4 changes: 4 additions & 0 deletions bokehjs/src/lib/core/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,17 @@ export abstract class BaseCoordinateSpec<T> extends DataSpec<T> {

export abstract class CoordinateSpec extends BaseCoordinateSpec<number | Factor> {}
export abstract class CoordinateSeqSpec extends BaseCoordinateSpec<number[] | Factor[]> {}
export abstract class CoordinateSeqSeqSeqSpec extends BaseCoordinateSpec<number[][][] | Factor[][][]> {}

export class XCoordinateSpec extends CoordinateSpec { readonly dimension = "x" }
export class YCoordinateSpec extends CoordinateSpec { readonly dimension = "y" }

export class XCoordinateSeqSpec extends CoordinateSeqSpec { readonly dimension = "x" }
export class YCoordinateSeqSpec extends CoordinateSeqSpec { readonly dimension = "y" }

export class XCoordinateSeqSeqSeqSpec extends CoordinateSeqSeqSeqSpec { readonly dimension = "x" }
export class YCoordinateSeqSeqSeqSpec extends CoordinateSeqSeqSeqSpec { readonly dimension = "y" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tossing out as an idea: what do you think of something like XCoordinateSeqSpec, XCoordinateSeq2Spec, XCoordinateSeq3Spec? I actually find SeqSeqSeqSpec harded to quickly visually parse

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add this to the overall "naming things" issue.


export class AngleSpec extends NumberUnitsSpec<enums.AngleUnits> {
get default_units(): enums.AngleUnits { return "rad" as "rad" }
get valid_units(): enums.AngleUnits[] { return enums.AngleUnits }
Expand Down
10 changes: 5 additions & 5 deletions bokehjs/src/lib/models/glyphs/multi_polygons.ts
Original file line number Diff line number Diff A7DB line change
Expand Up @@ -135,7 +135,7 @@ export class MultiPolygonsView extends GlyphView {
})
}

protected _inner_loop(ctx: Context2d, sx: Arrayable<Arrayable<Arrayable<number>>>, sy: Arrayable<Arrayable<Arrayable<number>>>): void {
protected _inner_loop(ctx: Context2d, sx: NumberArray[][], sy: NumberArray[][]): void {
ctx.beginPath()
for (let j = 0, endj = sx.length; j < endj; j++) {
for (let k = 0, endk = sx[j].length; k < endk; k++) {
Expand Down Expand Up @@ -316,8 +316,8 @@ export namespace MultiPolygons {
export type Attrs = p.AttrsOf<Props>

export type Props = Glyph.Props & {
xs: p.CoordinateSeqSpec
ys: p.CoordinateSeqSpec
xs: p.CoordinateSeqSeqSeqSpec
ys: p.CoordinateSeqSeqSeqSpec
} & Mixins

export type Mixins = LineVector & FillVector & HatchVector
Expand All @@ -339,8 +339,8 @@ export class MultiPolygons extends Glyph {
this.prototype.default_view = MultiPolygonsView

this.define<MultiPolygons.Props>({
xs: [ p.XCoordinateSeqSpec, {field: "xs"} ],
ys: [ p.YCoordinateSeqSpec, {field: "ys"} ],
xs: [ p.XCoordinateSeqSeqSeqSpec, {field: "xs"} ],
ys: [ p.YCoordinateSeqSeqSeqSpec, {field: "ys"} ],
})
this.mixins<MultiPolygons.Mixins>([LineVector, FillVector, HatchVector])
}
Expand Down
0