forked from bokeh/bokeh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bokeh:branch-3.6' into branch-3.6
- Loading branch information
Showing
156 changed files
with
1,446 additions
and
10,806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ | |
.sw[nop] | ||
*.tmp | ||
.vscode | ||
.idea | ||
|
||
# compressed / binary files | ||
*.bz2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {Model} from "../../model" | ||
import type * as p from "core/properties" | ||
|
||
export namespace Comparison { | ||
export type Attrs = p.AttrsOf<Props> | ||
|
||
export type Props = Model.Props | ||
} | ||
|
||
export interface Comparison extends Comparison.Attrs {} | ||
|
||
export abstract class Comparison extends Model { | ||
declare properties: Comparison.Props | ||
|
||
constructor(attrs?: Partial<Comparison.Attrs>) { | ||
super(attrs) | ||
} | ||
|
||
abstract compute(x: unknown, y: unknown): -1 | 0 | 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {Comparison} from "./comparison" | ||
import type * as p from "core/properties" | ||
import type {Dict} from "core/types" | ||
import {keys, values} from "core/util/object" | ||
import {use_strict} from "core/util/string" | ||
|
||
export namespace CustomJSCompare { | ||
export type Attrs = p.AttrsOf<Props> | ||
|
||
export type Props = Comparison.Props & { | ||
args: p.Property<Dict<unknown>> | ||
code: p.Property<string> | ||
} | ||
} | ||
|
||
export interface CustomJSCompare extends CustomJSCompare.Attrs {} | ||
|
||
export class CustomJSCompare extends Comparison { | ||
declare properties: CustomJSCompare.Props | ||
|
||
constructor(attrs?: Partial<CustomJSCompare.Attrs>) { | ||
super(attrs) | ||
} | ||
|
||
static { | ||
this.define<CustomJSCompare.Props>(({Unknown, Str, Dict}) => ({ | ||
args: [ Dict(Unknown), {} ], | ||
code: [ Str, "" ], | ||
})) | ||
} | ||
|
||
get names(): string[] { | ||
return keys(this.args) | ||
} | ||
|
||
get values(): unknown[] { | ||
return values(this.args) | ||
} | ||
|
||
private _make_func(): Function { | ||
const code = use_strict(this.code) | ||
return new Function("x", "y", ...this.names, code) | ||
} | ||
|
||
compute(x: unknown, y: unknown): 0 | 1 | -1 { | ||
const func = this._make_func() | ||
return func(x, y, this.values) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export {Comparison} from "./comparison" | ||
export {CustomJSCompare} from "./customjs_compare" | ||
export {NanCompare} from "./nan_compare" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {Comparison} from "./comparison" | ||
import {isNumber} from "core/util/types" | ||
import type * as p from "core/properties" | ||
|
||
export namespace NanCompare { | ||
export type Attrs = p.AttrsOf<Props> | ||
|
||
export type Props = Comparison.Props & { | ||
ascending_first: p.Property<boolean> | ||
} | ||
} | ||
|
||
export interface NanCompare extends NanCompare.Attrs {} | ||
|
||
export class NanCompare extends Comparison { | ||
declare properties: NanCompare.Props | ||
|
||
constructor(attrs?: Partial<NanCompare.Attrs>) { | ||
super(attrs) | ||
} | ||
|
||
static { | ||
this.define<NanCompare.Props>(({Bool}) => ({ | ||
ascending_first: [ Bool, false ], | ||
})) | ||
} | ||
|
||
compute(x: unknown, y: unknown): 0 | 1 | -1 { | ||
if (isNumber(x) && isNaN(x)) { | ||
return this.ascending_first ? -1 : 1 | ||
} | ||
if (isNumber(y) && isNaN(y)) { | ||
return this.ascending_first ? 1 : -1 | ||
} | ||
if (isNumber(x) && isNumber(y)) { | ||
return x==y ? 0 : x < y ? -1 : 1 | ||
} | ||
return 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.