跳转至

Derived property from function on objects(基于对象函数的派生属性)

Add a new transform table column backed by a Foundry function. The new column can be of type boolean, string, number, or time, depending on the output of the function.

To use a function in this transform, it must satisfy the following requirements:

  • The function input parameters must include an ObjectSet<ObjectType> parameter (and can optionally include other input parameters).
  • The function return type must be a FunctionsMap<ObjectType, CustomType>.
  • The FunctionsMap keys are objects with object IDs matching those in the table.
  • The FunctionsMap values are primitives.

See Function-backed columns for more information.

:::callout{theme="warning"} When defining a function that returns a numerical value, we recommend returning either Double or Integer over Float. :::

Input type

String, number, time, boolean

Output type

String

Usage information

Functionality Availability
Standard Quiver card Unsupported
Transform table transform Supported

中文翻译

基于对象函数的派生属性

新增一个由 Foundry 函数 支持的转换表列。根据函数的输出,新列的类型可以是布尔型(boolean)、字符串型(string)、数字型(number)或时间型(time)。

要在该转换中使用函数,必须满足以下要求:

  • 函数输入参数必须包含一个 ObjectSet<ObjectType> 参数(并可选择性地包含其他输入参数)。
  • 函数返回类型必须是 FunctionsMap<ObjectType, CustomType>
  • FunctionsMap 的键是对象,其对象 ID 与表中的对象 ID 相匹配。
  • FunctionsMap 的值是原始类型(primitives)。

更多信息请参见函数支持列

:::callout{theme="warning"} 在定义返回数值的函数时,建议优先使用 DoubleInteger 类型,而非 Float 类型。 :::

输入类型

字符串(string)、数字(number)、时间(time)、布尔值(boolean)

输出类型

字符串(string)

使用信息

功能 可用性
标准 Quiver 卡片 不支持
转换表转换 支持