DimensionsBuilder

ディメンションビルダー。ディメンション設定の追加、変更、削除に使います。ディメンションは時間、地域、商品カテゴリなど、データの分類フィールドです

メソッド

constructor

定義:

constructor(doc: Y.Doc, dsl: Y.Map<any>)

パラメータ:

パラメータ説明
docY.Doc-
dslY.Map-

add

ディメンションを追加

定義:

add(field: string, callback: (node: DimensionNodeBuilder) => void): DimensionsBuilder

戻り値: DimensionsBuilder

パラメータ:

パラメータ説明
fieldstring- フィールド名
callback(node: DimensionNodeBuilder) => void- コールバック関数

remove

指定 ID のディメンションを削除

定義:

remove(id: string): DimensionsBuilder

戻り値: DimensionsBuilder

パラメータ:

パラメータ説明
idstring- ディメンション ID

update

指定ディメンション ID の設定を更新

定義:

update(id: string, callback: (node: DimensionNodeBuilder) => void): DimensionsBuilder

戻り値: DimensionsBuilder

パラメータ:

パラメータ説明
idstring- ディメンション ID
callback(node: DimensionNodeBuilder) => void- コールバック関数

find

コールバック条件に一致する最初のディメンションを検索。動作は Array.find と同じ

定義:

find(predicate: (node: DimensionNodeBuilder, index: number) => boolean): DimensionNodeBuilder | undefined

戻り値: DimensionNodeBuilder \| undefined

パラメータ:

パラメータ説明
predicate(node: DimensionNodeBuilder, index: number) => boolean- 検索条件

findAll

すべてのディメンションを取得

定義:

findAll(): DimensionNodeBuilder[]

戻り値: DimensionNodeBuilder[]

toJSON

すべてのディメンションを JSON 配列としてエクスポート

定義:

toJSON(): VBIDimension[]

戻り値: VBIDimension[]

observe

ディメンション変更を監視し、監視解除関数を返す

定義:

observe(callback: ObserveDeepCallback): () => void

戻り値: () => void

パラメータ:

パラメータ説明
callbackObserveDeepCallback- コールバック関数

static isDimensionNode

定義:

static isDimensionNode(node: VBIDimensionTree[0]): node is VBIDimension

戻り値: node is VBIDimension

パラメータ:

パラメータ説明
nodeVBIDimensionTree[0]-

static isDimensionGroup

定義:

static isDimensionGroup(node: VBIDimensionTree[0]): node is VBIDimensionGroup

戻り値: node is VBIDimensionGroup

パラメータ:

パラメータ説明
nodeVBIDimensionTree[0]-