dolphindb 3.1.41 → 3.1.42

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/index.d.ts CHANGED
@@ -47,7 +47,9 @@ export interface DdbChartValue {
47
47
  z_axis?: string;
48
48
  };
49
49
  extras?: {
50
- multi_y_axes: boolean;
50
+ multi_y_axes?: boolean;
51
+ /** 自适应 y 轴,而不是从 0 刻度开始 */
52
+ auto_scale_y_axes?: boolean;
51
53
  };
52
54
  data: DdbMatrixObj;
53
55
  }
@@ -175,7 +177,7 @@ export interface InspectOptions extends UtilInspectOptions {
175
177
  export declare function format(type: DdbType, value: DdbValue, le: boolean, options?: InspectOptions): string;
176
178
  /** 格式化向量、集合中的第 index 项为字符串,空值返回 'null' 字符串 formatted vector, the index-th item in the collection is a string, a null value returns a 'null' string */
177
179
  export declare function formati(obj: DdbVectorObj, index: number, options?: InspectOptions): string;
178
- export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | string[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbSymbolExtendedValue | DdbExtObjValue | DdbTensorValue | Uint8Array<ArrayBufferLike> | IotVectorItemValue | DdbDurationVectorValue | DdbDecimal128VectorValue | BigInt128Array | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | DdbArrayVectorValue | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | DdbMatrixValue | DdbChartValue;
180
+ export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | string[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbSymbolExtendedValue | DdbExtObjValue | DdbTensorValue | Uint8Array<ArrayBufferLike> | IotVectorItemValue | DdbDurationVectorValue | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | BigInt128Array | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | DdbArrayVectorValue | DdbDecimal128VectorValue | DdbMatrixValue | DdbChartValue;
179
181
  /** 转换一个向量到 js 原生数组 */
180
182
  export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
181
183
  /** 构造 void 类型,默认为 `DdbVoidType.undefined` */
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { concat, assert, inspect, typed_array_to_buffer, connect_websocket, Lock, genid, seq, zip_object, WebSocketOpen, WebSocketClosed, WebSocketClosing, decode, check, empty, colored } from 'xshell';
1
+ import { concat, assert, inspect, typed_array_to_buffer, connect_websocket, Lock, genid, seq, zip_object, WebSocketOpen, WebSocketClosed, WebSocketClosing, decode, check, empty, colored, map_keys, to_lower_camel_case } from 'xshell';
2
2
  import { t } from "./i18n/index.js";
3
3
  import { ddb_tensor_bytes, DdbChartType, DdbDurationUnit, DdbForm, generate_array_type, DdbFunctionType, DdbType, DdbVoidType, dictables, function_definition_patterns, get_big_int_128, get_time_ddbobj, get_duration_unit, get_type_name, int1282str, ipaddr2str, is_decimal_null_value, is_decimal_type, time_formatters, number_nulls, nulls, set_big_int_128, SqlStandard, uuid2str, get_times_ddbobj, funcdefs, get_number_formatter, urgent } from "./common.js";
4
4
  export * from "./common.js";
@@ -169,15 +169,7 @@ export class DdbObj {
169
169
  },
170
170
  ...bin_start ? { bin_start, bin_end, } : {},
171
171
  ...bin_count ? { bin_count } : {},
172
- ...extras ? (() => {
173
- const { multiYAxes: multi_y_axes = false, ...extras_others } = extras.to_dict({ strip: true });
174
- return {
175
- extras: {
176
- multi_y_axes,
177
- ...extras_others,
178
- }
179
- };
180
- })() : {},
172
+ ...extras ? { extras: map_keys(extras.data()) } : {},
181
173
  data,
182
174
  ...others,
183
175
  };
@@ -959,10 +951,9 @@ export class DdbObj {
959
951
  ...bin_start ? { binStart: bin_start, binEnd: bin_end } : {},
960
952
  ...bin_count ? { binCount: bin_count } : {},
961
953
  title: new DdbVectorString(titles),
962
- ...extras ? (() => {
963
- const { multi_y_axes, ...extras_other } = extras;
964
- return { extras: new DdbDict({ multiYAxes: multi_y_axes, ...extras_other }) };
965
- })() : {},
954
+ ...extras ? {
955
+ extras: new DdbDict(map_keys(extras, to_lower_camel_case))
956
+ } : {},
966
957
  data,
967
958
  });
968
959
  return [keys.pack(), values.pack()];