sqlmath 2026.7.30 → 2026.9.29
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.
- package/CHANGELOG.md +16 -0
- package/README.md +53 -11
- package/_sqlmath.napi6_darwin_arm64.node +0 -0
- package/_sqlmath.napi6_darwin_x64.node +0 -0
- package/_sqlmath.napi6_linux_x64.node +0 -0
- package/_sqlmath.napi6_win32_x64.node +0 -0
- package/_sqlmath.shell_darwin_arm64 +0 -0
- package/_sqlmath.shell_darwin_x64 +0 -0
- package/_sqlmath.shell_linux_x64 +0 -0
- package/_sqlmath.shell_win32_x64.exe +0 -0
- package/jslint.mjs +2210 -975
- package/package.json +1 -1
- package/sqlmath/lib_lightgbm_darwin_arm64.dylib +0 -0
- package/sqlmath/lib_lightgbm_darwin_x64.dylib +0 -0
- package/sqlmath/lib_lightgbm_linux_x64.so +0 -0
- package/sqlmath/lib_lightgbm_win32_x64.dll +0 -0
- package/sqlmath.mjs +41 -37
- package/sqlmath_browser.mjs +103 -104
- package/sqlmath_wasm.js +1 -1
- package/sqlmath_wasm.wasm +0 -0
- package/test.mjs +597 -98
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/sqlmath.mjs
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
/*
|
|
24
24
|
sh one-liner:
|
|
25
|
+
npm_config_mode_test_save=1 npm run test && git diff
|
|
25
26
|
sh jslint_ci.sh shCiBuildWasm
|
|
26
27
|
sh jslint_ci.sh shSqlmathUpdate
|
|
27
28
|
*/
|
|
@@ -110,7 +111,7 @@ const SQLITE_OPEN_WAL = 0x00080000; /* VFS only */
|
|
|
110
111
|
|
|
111
112
|
const DB_EXEC_PROFILE_DICT = {}; //jslint-ignore-line
|
|
112
113
|
const DB_STATE = {};
|
|
113
|
-
const version = "v2026.
|
|
114
|
+
const version = "v2026.9.29";
|
|
114
115
|
let DB_EXEC_PROFILE_MODE;
|
|
115
116
|
let DB_EXEC_PROFILE_SQL_LENGTH;
|
|
116
117
|
let IS_BROWSER;
|
|
@@ -160,8 +161,8 @@ function assertInt64(val) {
|
|
|
160
161
|
-9_223_372_036_854_775_808n <= val && val <= 9_223_372_036_854_775_807n
|
|
161
162
|
)) {
|
|
162
163
|
throw new Error(
|
|
163
|
-
`integer ${val} outside signed-64-bit inclusive-range`
|
|
164
|
-
|
|
164
|
+
`integer ${val} outside signed-64-bit inclusive-range` +
|
|
165
|
+
" -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807"
|
|
165
166
|
);
|
|
166
167
|
}
|
|
167
168
|
}
|
|
@@ -174,8 +175,8 @@ function assertJsonEqual(aa, bb, message) {
|
|
|
174
175
|
bb = JSON.stringify(objectDeepCopyWithKeysSorted(bb), undefined, 1);
|
|
175
176
|
if (aa !== bb) {
|
|
176
177
|
throw new Error(
|
|
177
|
-
"\n" + aa + "\n!==\n" + bb
|
|
178
|
-
|
|
178
|
+
"\n" + aa + "\n!==\n" + bb +
|
|
179
|
+
(
|
|
179
180
|
typeof message === "string"
|
|
180
181
|
? " - " + message
|
|
181
182
|
: message
|
|
@@ -790,13 +791,16 @@ async function dbCallAsync(baton, argList, mode, db) {
|
|
|
790
791
|
// check for min/max safe-integer
|
|
791
792
|
assertOrThrow(
|
|
792
793
|
(
|
|
793
|
-
(
|
|
794
|
-
|
|
794
|
+
(
|
|
795
|
+
JS_MIN_SAFE_INTEGER <= val &&
|
|
796
|
+
val <= JS_MAX_SAFE_INTEGER
|
|
797
|
+
) ||
|
|
798
|
+
typeof val === "bigint"
|
|
795
799
|
),
|
|
796
800
|
(
|
|
797
|
-
"dbCallAsync - "
|
|
798
|
-
|
|
799
|
-
|
|
801
|
+
"dbCallAsync - " +
|
|
802
|
+
"non-bigint-integer must be within inclusive-range" +
|
|
803
|
+
` ${JS_MIN_SAFE_INTEGER} to ${JS_MAX_SAFE_INTEGER}`
|
|
800
804
|
)
|
|
801
805
|
);
|
|
802
806
|
val = BigInt(val);
|
|
@@ -817,8 +821,8 @@ async function dbCallAsync(baton, argList, mode, db) {
|
|
|
817
821
|
assertOrThrow(
|
|
818
822
|
!ArrayBuffer.isView(val) || val.byteOffset === 0,
|
|
819
823
|
(
|
|
820
|
-
"dbCallAsync - argList cannot contain arraybuffer-views"
|
|
821
|
-
|
|
824
|
+
"dbCallAsync - argList cannot contain arraybuffer-views" +
|
|
825
|
+
" with non-zero byteOffset"
|
|
822
826
|
)
|
|
823
827
|
);
|
|
824
828
|
if (isExternalBuffer(val)) {
|
|
@@ -877,9 +881,9 @@ async function dbCallAsync(baton, argList, mode, db) {
|
|
|
877
881
|
timeElapsed = Date.now() - timeElapsed;
|
|
878
882
|
if (timeElapsed > 500 || funcname === "testTimeElapsed") {
|
|
879
883
|
consoleError(
|
|
880
|
-
"sqlMessagePost - "
|
|
881
|
-
|
|
882
|
-
|
|
884
|
+
"sqlMessagePost - " +
|
|
885
|
+
JSON.stringify({funcname, timeElapsed}) +
|
|
886
|
+
errStack
|
|
883
887
|
);
|
|
884
888
|
}
|
|
885
889
|
assertOrThrow(!result.errmsg, result.errmsg);
|
|
@@ -1091,16 +1095,16 @@ function dbExecProfile({
|
|
|
1091
1095
|
timeElapsed
|
|
1092
1096
|
}, ii) {
|
|
1093
1097
|
return String(
|
|
1094
|
-
`${Number(ii + 1).toFixed(0).padStart(2, " ")}.`
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
+
`${Number(ii + 1).toFixed(0).padStart(2, " ")}.` +
|
|
1099
|
+
` ${timeElapsed.toFixed(0).padStart(4)}` +
|
|
1100
|
+
` ${count.toFixed(0).padStart(3)}` +
|
|
1101
|
+
" " + JSON.stringify(sql)
|
|
1098
1102
|
).slice(0, lineLength);
|
|
1099
1103
|
}).join("\n");
|
|
1100
1104
|
result = (
|
|
1101
|
-
`\ndbExecProfile:\n`
|
|
1102
|
-
|
|
1103
|
-
|
|
1105
|
+
`\ndbExecProfile:\n` +
|
|
1106
|
+
` # time cnt sql\n` +
|
|
1107
|
+
`${result}\n`
|
|
1104
1108
|
);
|
|
1105
1109
|
return result;
|
|
1106
1110
|
}
|
|
@@ -1384,11 +1388,11 @@ async function dbTableImportAsync({
|
|
|
1384
1388
|
rowList.length === 0
|
|
1385
1389
|
? `CREATE TABLE ${tableName} (${colList.join(",")});`
|
|
1386
1390
|
: (
|
|
1387
|
-
`CREATE TABLE ${tableName} AS SELECT `
|
|
1388
|
-
|
|
1391
|
+
`CREATE TABLE ${tableName} AS SELECT ` +
|
|
1392
|
+
colList.map(function (colName, ii) {
|
|
1389
1393
|
return "value->>" + ii + " AS " + colName;
|
|
1390
|
-
}).join(",")
|
|
1391
|
-
|
|
1394
|
+
}).join(",") +
|
|
1395
|
+
" FROM JSON_EACH($rowList);"
|
|
1392
1396
|
)
|
|
1393
1397
|
)
|
|
1394
1398
|
});
|
|
@@ -1656,8 +1660,8 @@ function jsbatonSetValue(baton, argi, val, bufi, referenceList) {
|
|
|
1656
1660
|
assertOrThrow(
|
|
1657
1661
|
0 <= vsize && vsize <= SIZEOF_BLOB_MAX,
|
|
1658
1662
|
(
|
|
1659
|
-
"sqlite-blob byte-length must be within inclusive-range"
|
|
1660
|
-
|
|
1663
|
+
"sqlite-blob byte-length must be within inclusive-range" +
|
|
1664
|
+
` 0 to ${SIZEOF_BLOB_MAX}`
|
|
1661
1665
|
)
|
|
1662
1666
|
);
|
|
1663
1667
|
// push vsize - 4-byte
|
|
@@ -1674,8 +1678,8 @@ function jsbatonSetValue(baton, argi, val, bufi, referenceList) {
|
|
|
1674
1678
|
assertOrThrow(
|
|
1675
1679
|
0 <= vsize && vsize <= SIZEOF_BLOB_MAX,
|
|
1676
1680
|
(
|
|
1677
|
-
"sqlite-blob byte-length must be within inclusive-range"
|
|
1678
|
-
|
|
1681
|
+
"sqlite-blob byte-length must be within inclusive-range" +
|
|
1682
|
+
` 0 to ${SIZEOF_BLOB_MAX}`
|
|
1679
1683
|
)
|
|
1680
1684
|
);
|
|
1681
1685
|
assertOrThrow(
|
|
@@ -1713,8 +1717,8 @@ function jsonParseArraybuffer(buf) {
|
|
|
1713
1717
|
IS_BROWSER
|
|
1714
1718
|
? new TextDecoder().decode(buf)
|
|
1715
1719
|
: buf
|
|
1716
|
-
)
|
|
1717
|
-
|
|
1720
|
+
) ||
|
|
1721
|
+
"null"
|
|
1718
1722
|
);
|
|
1719
1723
|
}
|
|
1720
1724
|
|
|
@@ -1775,8 +1779,8 @@ async function moduleFsInit() {
|
|
|
1775
1779
|
}
|
|
1776
1780
|
SQLMATH_NODE = `_sqlmath.napi6_${process.platform}_${process.arch}.node`;
|
|
1777
1781
|
SQLMATH_EXE = (
|
|
1778
|
-
`_sqlmath.shell_${process.platform}_${process.arch}`
|
|
1779
|
-
|
|
1782
|
+
`_sqlmath.shell_${process.platform}_${process.arch}` +
|
|
1783
|
+
process.platform.replace(
|
|
1780
1784
|
"win32",
|
|
1781
1785
|
".exe"
|
|
1782
1786
|
).replace(
|
|
@@ -1843,9 +1847,9 @@ async function sqlmathInit() {
|
|
|
1843
1847
|
// Feature-detect nodejs.
|
|
1844
1848
|
|
|
1845
1849
|
if (
|
|
1846
|
-
typeof process !== "object"
|
|
1847
|
-
|
|
1848
|
-
|
|
1850
|
+
typeof process !== "object" ||
|
|
1851
|
+
typeof process?.versions?.node !== "string" ||
|
|
1852
|
+
cModule
|
|
1849
1853
|
) {
|
|
1850
1854
|
return;
|
|
1851
1855
|
}
|
package/sqlmath_browser.mjs
CHANGED
|
@@ -408,16 +408,16 @@ ALTER TABLE tradebot_tech_intra_month DROP COLUMN xdate2;
|
|
|
408
408
|
: "tradebot_historical"
|
|
409
409
|
);
|
|
410
410
|
tableChart = (
|
|
411
|
-
"chart._{{ii}}_tradebot_historical_"
|
|
412
|
-
|
|
411
|
+
"chart._{{ii}}_tradebot_historical_" +
|
|
412
|
+
dateInterval.replace((
|
|
413
413
|
/\W/g
|
|
414
414
|
), "_")
|
|
415
415
|
);
|
|
416
416
|
optionDict = {
|
|
417
417
|
title: (
|
|
418
|
-
"tradebot historical performance vs market - "
|
|
419
|
-
+
|
|
420
|
-
|
|
418
|
+
"tradebot historical performance vs market - " +
|
|
419
|
+
dateInterval +
|
|
420
|
+
(
|
|
421
421
|
dateInterval === "1 day"
|
|
422
422
|
? "\n[ updated " + new Date(
|
|
423
423
|
tradebotState.datenow + "Z"
|
|
@@ -944,16 +944,16 @@ INSERT INTO chart._{{ii}}_tradebot_buysell_history (
|
|
|
944
944
|
: "tradebot_tech_intra"
|
|
945
945
|
);
|
|
946
946
|
tableChart = (
|
|
947
|
-
"chart._{{ii}}_tradebot_tech_intra_"
|
|
948
|
-
|
|
947
|
+
"chart._{{ii}}_tradebot_tech_intra_" +
|
|
948
|
+
dateInterval.replace((
|
|
949
949
|
/\W/g
|
|
950
950
|
), "_")
|
|
951
951
|
);
|
|
952
952
|
optionDict = {
|
|
953
953
|
title: (
|
|
954
|
-
"tradebot technical intraday - "
|
|
955
|
-
+
|
|
956
|
-
|
|
954
|
+
"tradebot technical intraday - " +
|
|
955
|
+
dateInterval +
|
|
956
|
+
(
|
|
957
957
|
dateInterval === "1 day"
|
|
958
958
|
? "\n[ updated " + new Date(
|
|
959
959
|
tradebotState.datenow + "Z"
|
|
@@ -1258,11 +1258,11 @@ function fileSave({
|
|
|
1258
1258
|
), "_").replace((
|
|
1259
1259
|
/_([^_]+)$/
|
|
1260
1260
|
), (
|
|
1261
|
-
"_"
|
|
1262
|
-
|
|
1261
|
+
"_" +
|
|
1262
|
+
new Date().toISOString().slice(0, 10).replace((
|
|
1263
1263
|
/-/g
|
|
1264
|
-
), "")
|
|
1265
|
-
|
|
1264
|
+
), "") +
|
|
1265
|
+
".$1"
|
|
1266
1266
|
));
|
|
1267
1267
|
UI_FILE_SAVE.click();
|
|
1268
1268
|
}
|
|
@@ -1517,8 +1517,8 @@ function onContextmenu(evt) {
|
|
|
1517
1517
|
});
|
|
1518
1518
|
// contextmenu - show
|
|
1519
1519
|
UI_CONTEXTMENU.children[0].innerHTML = (
|
|
1520
|
-
"crud operation for:<br>"
|
|
1521
|
-
|
|
1520
|
+
"crud operation for:<br>" +
|
|
1521
|
+
stringHtmlSafe(baton.dbtableFullname || "script editor")
|
|
1522
1522
|
);
|
|
1523
1523
|
uiFadeIn(UI_CONTEXTMENU);
|
|
1524
1524
|
UI_CONTEXTMENU.style.left = Math.max(0, Math.min(
|
|
@@ -1579,13 +1579,13 @@ async function onDbAction(evt) {
|
|
|
1579
1579
|
<td><span class="crudLabel">{{selected_column}}</span></td>
|
|
1580
1580
|
<td class="tdInput">
|
|
1581
1581
|
<select class="crudInput">
|
|
1582
|
-
`)
|
|
1583
|
-
|
|
1582
|
+
`) +
|
|
1583
|
+
baton.colList.slice(1).map(function (col) {
|
|
1584
1584
|
return (
|
|
1585
1585
|
`<option>${stringHtmlSafe(col)}</option>`
|
|
1586
1586
|
);
|
|
1587
|
-
}).join("")
|
|
1588
|
-
|
|
1587
|
+
}).join("") +
|
|
1588
|
+
(`
|
|
1589
1589
|
</select>
|
|
1590
1590
|
</td>
|
|
1591
1591
|
</tr>
|
|
@@ -1621,22 +1621,22 @@ TO
|
|
|
1621
1621
|
"{{new_column}}";
|
|
1622
1622
|
|
|
1623
1623
|
-- row - insert
|
|
1624
|
-
INSERT INTO ${baton.dbtableFullname} (`
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1624
|
+
INSERT INTO ${baton.dbtableFullname} (` +
|
|
1625
|
+
JSON.stringify(baton.colList.slice(1), undefined, 4).slice(1, -1) +
|
|
1626
|
+
`) VALUES (\n` +
|
|
1627
|
+
`${" NULL,\n".repeat(baton.colList.length - 2)} NULL` +
|
|
1628
|
+
`
|
|
1629
1629
|
);
|
|
1630
1630
|
|
|
1631
1631
|
-- row - update
|
|
1632
1632
|
UPDATE
|
|
1633
1633
|
${baton.dbtableFullname}
|
|
1634
1634
|
SET
|
|
1635
|
-
`
|
|
1636
|
-
|
|
1635
|
+
` +
|
|
1636
|
+
baton.colList.slice(1).map(function (col) {
|
|
1637
1637
|
return ` "${col}" = NULL`;
|
|
1638
|
-
}).join(",\n")
|
|
1639
|
-
|
|
1638
|
+
}).join(",\n") +
|
|
1639
|
+
`
|
|
1640
1640
|
WHERE
|
|
1641
1641
|
rowid = ${baton.rowid};
|
|
1642
1642
|
|
|
@@ -1757,8 +1757,8 @@ RENAME TO
|
|
|
1757
1757
|
switch (action) {
|
|
1758
1758
|
case "dbDetach":
|
|
1759
1759
|
if (!window.confirm(
|
|
1760
|
-
"are you sure you want to detach and close database"
|
|
1761
|
-
|
|
1760
|
+
"are you sure you want to detach and close database" +
|
|
1761
|
+
` ${baton.dbName} ?`
|
|
1762
1762
|
)) {
|
|
1763
1763
|
return;
|
|
1764
1764
|
}
|
|
@@ -1791,8 +1791,8 @@ RENAME TO
|
|
|
1791
1791
|
return;
|
|
1792
1792
|
case "dbrowDelete":
|
|
1793
1793
|
if (!window.confirm(
|
|
1794
|
-
`are you sure you want to delete row with rowid = ${baton.rowid}`
|
|
1795
|
-
|
|
1794
|
+
`are you sure you want to delete row with rowid = ${baton.rowid}` +
|
|
1795
|
+
` in table ${baton.dbtableFullname} ?`
|
|
1796
1796
|
)) {
|
|
1797
1797
|
return;
|
|
1798
1798
|
}
|
|
@@ -1854,11 +1854,11 @@ DELETE FROM ${baton.dbtableName} WHERE rowid = ${baton.rowid};
|
|
|
1854
1854
|
db: baton.db,
|
|
1855
1855
|
responseType: "list",
|
|
1856
1856
|
sql: (
|
|
1857
|
-
`SELECT `
|
|
1858
|
-
|
|
1857
|
+
`SELECT ` +
|
|
1858
|
+
baton.colList.map(function (col) {
|
|
1859
1859
|
return `COLUMNTYPE(${col}) AS ${col}`;
|
|
1860
|
-
}).join(",")
|
|
1861
|
-
|
|
1860
|
+
}).join(",") +
|
|
1861
|
+
` FROM ${baton.dbtableName};`
|
|
1862
1862
|
)
|
|
1863
1863
|
});
|
|
1864
1864
|
columntypeList = columntypeList[0][1];
|
|
@@ -1876,9 +1876,9 @@ DELETE FROM ${baton.dbtableName} WHERE rowid = ${baton.rowid};
|
|
|
1876
1876
|
-- SELECT * FROM __sqlite_table_01;
|
|
1877
1877
|
-- ALTER TABLE __sqlite_table_01 RENAME TO __sqlite_table_02;
|
|
1878
1878
|
-- EXEC sp_rename '__sqlite_table_01', '__sqlite_table_02';
|
|
1879
|
-
`).trim()
|
|
1880
|
-
|
|
1881
|
-
|
|
1879
|
+
`).trim() +
|
|
1880
|
+
`\nCREATE TABLE __sqlite_table_01 (\n` +
|
|
1881
|
+
baton.colList.map(function (col, ii) {
|
|
1882
1882
|
col = col.replace((/\W/g), "_");
|
|
1883
1883
|
col = col.replace((/^\d/), "_$&");
|
|
1884
1884
|
// #define SQLITE_INTEGER 1
|
|
@@ -1900,12 +1900,12 @@ DELETE FROM ${baton.dbtableName} WHERE rowid = ${baton.rowid};
|
|
|
1900
1900
|
default:
|
|
1901
1901
|
return ` ${col} INTEGER`;
|
|
1902
1902
|
}
|
|
1903
|
-
}).join(",\n")
|
|
1904
|
-
|
|
1905
|
-
|
|
1903
|
+
}).join(",\n") +
|
|
1904
|
+
`\n);\n` +
|
|
1905
|
+
data.map(function (rowList) {
|
|
1906
1906
|
return (
|
|
1907
|
-
`INSERT INTO __sqlite_table_01 VALUES (`
|
|
1908
|
-
|
|
1907
|
+
`INSERT INTO __sqlite_table_01 VALUES (` +
|
|
1908
|
+
rowList.map(function (val, ii) {
|
|
1909
1909
|
switch (val !== null && columntypeList[ii]) {
|
|
1910
1910
|
case 1: // SQLITE_INTEGER
|
|
1911
1911
|
case 2: // SQLITE_FLOAT
|
|
@@ -1919,8 +1919,8 @@ DELETE FROM ${baton.dbtableName} WHERE rowid = ${baton.rowid};
|
|
|
1919
1919
|
default:
|
|
1920
1920
|
return "NULL";
|
|
1921
1921
|
}
|
|
1922
|
-
}).join(",")
|
|
1923
|
-
|
|
1922
|
+
}).join(",") +
|
|
1923
|
+
`);\n`
|
|
1924
1924
|
);
|
|
1925
1925
|
}).join("")
|
|
1926
1926
|
);
|
|
@@ -2195,8 +2195,8 @@ function svgAnimate(elem, attrDict, mode) {
|
|
|
2195
2195
|
// animate - linear fxnow, fxprg
|
|
2196
2196
|
if (!isDone) {
|
|
2197
2197
|
fxprg = (
|
|
2198
|
-
UI_ANIMATE_DURATION_INV
|
|
2199
|
-
|
|
2198
|
+
UI_ANIMATE_DURATION_INV *
|
|
2199
|
+
(UI_ANIMATE_DATENOW - datebeg)
|
|
2200
2200
|
);
|
|
2201
2201
|
if (mode === "easeout") {
|
|
2202
2202
|
fxprg = Math.sqrt(fxprg);
|
|
@@ -2603,15 +2603,15 @@ SELECT COUNT(*) AS rowcount FROM ${dbtableName};
|
|
|
2603
2603
|
: ` data-dbtype="table"`
|
|
2604
2604
|
);
|
|
2605
2605
|
html += (
|
|
2606
|
-
` title="`
|
|
2607
|
-
|
|
2606
|
+
` title="` +
|
|
2607
|
+
stringHtmlSafe((
|
|
2608
2608
|
`right-click for crud operation\n\n`
|
|
2609
2609
|
) + JSON.stringify({
|
|
2610
2610
|
dbtableFullname,
|
|
2611
2611
|
rowCount,
|
|
2612
2612
|
colList //jslint-ignore-line
|
|
2613
|
-
}, undefined, 4))
|
|
2614
|
-
|
|
2613
|
+
}, undefined, 4)) +
|
|
2614
|
+
`"`
|
|
2615
2615
|
);
|
|
2616
2616
|
html += `>${ii + 1}. `;
|
|
2617
2617
|
html += (
|
|
@@ -2652,8 +2652,8 @@ async function uiTryCatch(func, ...argList) {
|
|
|
2652
2652
|
await waitAsync(500);
|
|
2653
2653
|
UI_LOADING_COUNTER -= 1;
|
|
2654
2654
|
if (
|
|
2655
|
-
UI_LOADING_COUNTER === 0
|
|
2656
|
-
|
|
2655
|
+
UI_LOADING_COUNTER === 0 &&
|
|
2656
|
+
UI_LOADING.style.visibility === "visible"
|
|
2657
2657
|
) {
|
|
2658
2658
|
uiFadeOut(UI_LOADING);
|
|
2659
2659
|
}
|
|
@@ -3048,9 +3048,9 @@ SELECT
|
|
|
3048
3048
|
}
|
|
3049
3049
|
// skip ticklabel, if elemTick is not contained in xlabelList
|
|
3050
3050
|
if (
|
|
3051
|
-
isXaxis
|
|
3052
|
-
|
|
3053
|
-
|
|
3051
|
+
isXaxis &&
|
|
3052
|
+
xlabelList.length &&
|
|
3053
|
+
!xlabelList.hasOwnProperty(tickx - 1)
|
|
3054
3054
|
) {
|
|
3055
3055
|
return elemTick;
|
|
3056
3056
|
}
|
|
@@ -3193,11 +3193,11 @@ SELECT
|
|
|
3193
3193
|
}
|
|
3194
3194
|
if (evt.deltaY < 0) {
|
|
3195
3195
|
xmid = (
|
|
3196
|
-
evt.pageX
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3196
|
+
evt.pageX -
|
|
3197
|
+
elemCanvasFixed.getBoundingClientRect().left -
|
|
3198
|
+
window.scrollX +
|
|
3199
|
+
document.documentElement.clientLeft -
|
|
3200
|
+
plotLeft
|
|
3201
3201
|
) / plotWidth;
|
|
3202
3202
|
xscale = 0.8000; // zoom-in
|
|
3203
3203
|
}
|
|
@@ -3229,9 +3229,9 @@ SELECT
|
|
|
3229
3229
|
// get closest-series-point to mouse as pointHovered
|
|
3230
3230
|
pointObj = xpixelToPointDictHovered[mouseX];
|
|
3231
3231
|
if (
|
|
3232
|
-
!pointObj
|
|
3233
|
-
|
|
3234
|
-
|
|
3232
|
+
!pointObj ||
|
|
3233
|
+
pointObj === pointHovered ||
|
|
3234
|
+
pointObj.series.isHidden
|
|
3235
3235
|
) {
|
|
3236
3236
|
return;
|
|
3237
3237
|
}
|
|
@@ -3356,11 +3356,11 @@ SELECT
|
|
|
3356
3356
|
/^#(..)(..)(..)$/
|
|
3357
3357
|
), function (ignore, rr, gg, bb) {
|
|
3358
3358
|
return (
|
|
3359
|
-
"rgb("
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3359
|
+
"rgb(" +
|
|
3360
|
+
Math.round(0.5 * parseInt(rr, 16)) + "," +
|
|
3361
|
+
Math.round(0.5 * parseInt(gg, 16)) + "," +
|
|
3362
|
+
Math.round(0.5 * parseInt(bb, 16)) +
|
|
3363
|
+
")"
|
|
3364
3364
|
);
|
|
3365
3365
|
});
|
|
3366
3366
|
seriesHovered.pointListSeries.forEach(function (pointObj) {
|
|
@@ -3620,8 +3620,7 @@ SELECT
|
|
|
3620
3620
|
]).some(function (multiple, ii, list) {
|
|
3621
3621
|
tickMultiple = multiple;
|
|
3622
3622
|
return (
|
|
3623
|
-
2 * tickInterval
|
|
3624
|
-
<=
|
|
3623
|
+
2 * tickInterval <=
|
|
3625
3624
|
tickMultiple + (list[ii + 1] || tickMultiple)
|
|
3626
3625
|
);
|
|
3627
3626
|
});
|
|
@@ -3674,8 +3673,8 @@ SELECT
|
|
|
3674
3673
|
tickx, elemTick
|
|
3675
3674
|
]) {
|
|
3676
3675
|
if (
|
|
3677
|
-
elemTick.isXaxis !== isXaxis
|
|
3678
|
-
|
|
3676
|
+
elemTick.isXaxis !== isXaxis ||
|
|
3677
|
+
tickxList.indexOf(Number(tickx)) !== -1
|
|
3679
3678
|
) {
|
|
3680
3679
|
return;
|
|
3681
3680
|
}
|
|
@@ -3775,8 +3774,8 @@ SELECT
|
|
|
3775
3774
|
if (elemGridline) {
|
|
3776
3775
|
svgAttrSet(elemGridline, {
|
|
3777
3776
|
d: (
|
|
3778
|
-
`M ${plotLeft} ${yy}`
|
|
3779
|
-
|
|
3777
|
+
`M ${plotLeft} ${yy}` +
|
|
3778
|
+
` L ${canvasWidth - plotRight} ${yy}`
|
|
3780
3779
|
)
|
|
3781
3780
|
});
|
|
3782
3781
|
}
|
|
@@ -3819,8 +3818,8 @@ SELECT
|
|
|
3819
3818
|
if (elemGridline) {
|
|
3820
3819
|
svgAnimate(elemGridline, {
|
|
3821
3820
|
d: (
|
|
3822
|
-
`M ${plotLeft} ${yy + CRISPY}`
|
|
3823
|
-
|
|
3821
|
+
`M ${plotLeft} ${yy + CRISPY}` +
|
|
3822
|
+
` L ${canvasWidth - plotRight} ${yy + CRISPY}`
|
|
3824
3823
|
)
|
|
3825
3824
|
});
|
|
3826
3825
|
}
|
|
@@ -3882,10 +3881,10 @@ SELECT
|
|
|
3882
3881
|
}
|
|
3883
3882
|
if (
|
|
3884
3883
|
128 <= (
|
|
3885
|
-
Math.pow(pointX - pointXPrv, 2)
|
|
3886
|
-
|
|
3887
|
-
)
|
|
3888
|
-
|
|
3884
|
+
Math.pow(pointX - pointXPrv, 2) +
|
|
3885
|
+
Math.pow(pointY - pointYPrv, 2)
|
|
3886
|
+
) ||
|
|
3887
|
+
ii + 1 === pointListSeries.length
|
|
3889
3888
|
) {
|
|
3890
3889
|
pointXPrv = pointX;
|
|
3891
3890
|
pointYPrv = pointY;
|
|
@@ -3910,9 +3909,9 @@ SELECT
|
|
|
3910
3909
|
? "M"
|
|
3911
3910
|
// lineto
|
|
3912
3911
|
: "L"
|
|
3913
|
-
)
|
|
3912
|
+
) +
|
|
3914
3913
|
// + ` ${pointX} ${pointY} `
|
|
3915
|
-
|
|
3914
|
+
` ${pointXPrv} ${pointYPrv} `
|
|
3916
3915
|
);
|
|
3917
3916
|
});
|
|
3918
3917
|
// if not isBarchart, then redraw elemGraph
|
|
@@ -4292,28 +4291,28 @@ async function uitableAjax(baton, {
|
|
|
4292
4291
|
return;
|
|
4293
4292
|
}
|
|
4294
4293
|
viewRowBeg = Math.max(0, Math.round(
|
|
4295
|
-
rowCount
|
|
4296
|
-
|
|
4297
|
-
|
|
4294
|
+
rowCount *
|
|
4295
|
+
elemScroller.scrollTop /
|
|
4296
|
+
(elemScroller.scrollHeight - 1 * UI_ROW_HEIGHT)
|
|
4298
4297
|
));
|
|
4299
4298
|
viewRowEnd = Math.min(rowCount, Math.round(viewRowBeg + UI_VIEW_SIZE));
|
|
4300
4299
|
// update table-view info
|
|
4301
4300
|
elemInfo.textContent = (
|
|
4302
|
-
"showing "
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4301
|
+
"showing " +
|
|
4302
|
+
new Intl.NumberFormat().format(viewRowBeg + 1) +
|
|
4303
|
+
" to " +
|
|
4304
|
+
new Intl.NumberFormat().format(viewRowEnd) +
|
|
4305
|
+
" of " +
|
|
4306
|
+
new Intl.NumberFormat().format(rowCount) +
|
|
4307
|
+
" rows"
|
|
4309
4308
|
);
|
|
4310
4309
|
// skip expensive table-redraw, if scroll-point is within boundaries
|
|
4311
4310
|
if (
|
|
4312
|
-
contentElem.dataset.init !== "0"
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
Math.min(rowCount, viewRowEnd + 1 * UI_VIEW_SIZE)
|
|
4316
|
-
|
|
4311
|
+
contentElem.dataset.init !== "0" &&
|
|
4312
|
+
baton.rowOffset <= Math.max(0, viewRowBeg - 1 * UI_VIEW_SIZE) &&
|
|
4313
|
+
(
|
|
4314
|
+
Math.min(rowCount, viewRowEnd + 1 * UI_VIEW_SIZE) <=
|
|
4315
|
+
baton.rowOffset + UI_PAGE_SIZE
|
|
4317
4316
|
)
|
|
4318
4317
|
) {
|
|
4319
4318
|
return;
|
|
@@ -4442,15 +4441,15 @@ function uitableCreate(baton) {
|
|
|
4442
4441
|
<table class="uitableTable">
|
|
4443
4442
|
<thead>
|
|
4444
4443
|
<tr>
|
|
4445
|
-
`)
|
|
4446
|
-
|
|
4444
|
+
`) +
|
|
4445
|
+
jsonHtmlSafe(baton.colList).map(function (col, ii) {
|
|
4447
4446
|
return (
|
|
4448
4447
|
ii === 0
|
|
4449
4448
|
? `<th title="${col}" data-sort="asc">${col}</th>`
|
|
4450
4449
|
: `<th title="${col}">${col}</th>`
|
|
4451
4450
|
);
|
|
4452
|
-
}).join("")
|
|
4453
|
-
|
|
4451
|
+
}).join("") +
|
|
4452
|
+
(`
|
|
4454
4453
|
</tr>
|
|
4455
4454
|
</thead>
|
|
4456
4455
|
<tbody>
|
package/sqlmath_wasm.js
CHANGED
package/sqlmath_wasm.wasm
CHANGED
|
Binary file
|