@uwdata/mosaic-sql 0.21.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin-histogram.d.ts","sourceRoot":"","sources":["../../../src/transforms/bin-histogram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"bin-histogram.d.ts","sourceRoot":"","sources":["../../../src/transforms/bin-histogram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAK7C,OAAO,EAAE,KAAK,EAAkB,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACxB,OAAO,GAAE,mBAAwB,EACjC,SAAS,GAAE,KAAK,CAAC,MAAM,CAAuC,GAC7D,QAAQ,CAmBV"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { float64 } from '../functions/cast.js';
|
|
2
2
|
import { floor } from '../functions/numeric.js';
|
|
3
3
|
import { add, div, mul, sub } from '../functions/operators.js';
|
|
4
|
-
import { asNode } from '../util/ast.js';
|
|
5
4
|
import { binSpec } from './util/bin-step.js';
|
|
6
5
|
import { scaleTransform } from './scales.js';
|
|
7
6
|
/**
|
|
@@ -18,7 +17,7 @@ export function binHistogram(field, extent, options = {}, transform = scaleTrans
|
|
|
18
17
|
const { offset = 0 } = options;
|
|
19
18
|
// handle degenerate extent
|
|
20
19
|
if (max === min)
|
|
21
|
-
return offset ? add(offset, field) :
|
|
20
|
+
return offset ? add(offset, floor(field)) : floor(field);
|
|
22
21
|
const { apply, sqlApply, sqlInvert } = transform;
|
|
23
22
|
const b = binSpec(apply(min), apply(max), options);
|
|
24
23
|
const col = sqlApply(field);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin-histogram.js","sourceRoot":"","sources":["../../../src/transforms/bin-histogram.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bin-histogram.js","sourceRoot":"","sources":["../../../src/transforms/bin-histogram.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAS,cAAc,EAAE,MAAM,aAAa,CAAC;AA0BpD;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAgB,EAChB,MAAwB,EACxB,UAA+B,EAAE,EACjC,YAA2B,cAAc,CAAC,EAAE,IAAI,EAA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AC,CAAC,GAAG,KAAK,CAAC;QAAE,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uwdata/mosaic-sql",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "SQL query construction and analysis.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sql",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"test": "vitest run",
|
|
30
30
|
"prepublishOnly": "npm run test && npm run lint && tsc --build"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "296762423ac032193344646ad4f10cf604ca69a2"
|
|
33
33
|
}
|
|
@@ -3,7 +3,6 @@ import type { ExprValue } from '../types.js';
|
|
|
3
3
|
import { float64 } from '../functions/cast.js';
|
|
4
4
|
import { floor } from '../functions/numeric.js';
|
|
5
5
|
import { add, div, mul, sub } from '../functions/operators.js';
|
|
6
|
-
import { asNode } from '../util/ast.js';
|
|
7
6
|
import { binSpec } from './util/bin-step.js';
|
|
8
7
|
import { Scale, scaleTransform } from './scales.js';
|
|
9
8
|
|
|
@@ -50,7 +49,7 @@ export function binHistogram(
|
|
|
50
49
|
const { offset = 0 } = options;
|
|
51
50
|
|
|
52
51
|
// handle degenerate extent
|
|
53
|
-
if (max === min) return offset ? add(offset, field) :
|
|
52
|
+
if (max === min) return offset ? add(offset, floor(field)) : floor(field);
|
|
54
53
|
|
|
55
54
|
const { apply, sqlApply, sqlInvert } = transform;
|
|
56
55
|
const b = binSpec(apply(min), apply(max), options);
|