MCPcopy Index your code
hub / github.com/apache/echarts / bisect

Function bisect

src/scale/Time.ts:96–112  ·  view source on GitHub ↗
(
    a: [string | number, number][],
    x: number,
    lo: number,
    hi: number
)

Source from the content-addressed store, hash-verified

94
95// FIXME 公用?
96const bisect = function (
97 a: [string | number, number][],
98 x: number,
99 lo: number,
100 hi: number
101): number {
102 while (lo < hi) {
103 const mid = lo + hi >>> 1;
104 if (a[mid][1] < x) {
105 lo = mid + 1;
106 }
107 else {
108 hi = mid;
109 }
110 }
111 return lo;
112};
113
114type TimeScaleSetting = {
115 locale: Model<LocaleOption>;

Callers 1

calcNiceForTimeScaleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…