dolphindb 3.1.34 → 3.1.36
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/example.html +18 -0
- package/index.js +7 -1
- package/index.js.map +1 -1
- package/language.d.ts +1 -1
- package/language.js +10 -0
- package/language.js.map +1 -1
- package/package.json +3 -3
package/example.html
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>DolphinDB</title>
|
|
5
|
+
<meta charset='utf-8' />
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div>open devtools (press f12) to view output</div>
|
|
9
|
+
<script type="module">
|
|
10
|
+
import { DDB } from 'https://cdn.dolphindb.cn/assets/api.js'
|
|
11
|
+
|
|
12
|
+
let ddb = new DDB('ws://127.0.0.1:8848')
|
|
13
|
+
|
|
14
|
+
console.log(
|
|
15
|
+
await ddb.execute('1 + 1'))
|
|
16
|
+
</script>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
package/index.js
CHANGED
|
@@ -947,12 +947,18 @@ export class DdbObj {
|
|
|
947
947
|
return [value[0].pack(), value[1].pack()];
|
|
948
948
|
case DdbForm.chart: {
|
|
949
949
|
const { type, stacking, bin_start, bin_end, bin_count, titles: { chart, x_axis, y_axis, z_axis }, extras, data } = this.value;
|
|
950
|
+
let titles = [];
|
|
951
|
+
for (const title of [chart, x_axis, y_axis, z_axis])
|
|
952
|
+
if (empty(title))
|
|
953
|
+
break;
|
|
954
|
+
else
|
|
955
|
+
titles.push(title);
|
|
950
956
|
const { value: [keys, values] } = new DdbDict({
|
|
951
957
|
chartType: new DdbInt(type),
|
|
952
958
|
stacking,
|
|
953
959
|
...bin_start ? { binStart: bin_start, binEnd: bin_end } : {},
|
|
954
960
|
...bin_count ? { binCount: bin_count } : {},
|
|
955
|
-
title: new DdbVectorString(
|
|
961
|
+
title: new DdbVectorString(titles),
|
|
956
962
|
...extras ? (() => {
|
|
957
963
|
const { multi_y_axes, ...extras_other } = extras;
|
|
958
964
|
return { extras: new DdbDict({ multiYAxes: multi_y_axes, ...extras_other }) };
|