Skip to content

lib-nav 库参考 ​

原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793750685/FIN+5.3.1+lib-nav 中文整理基于 FIN 5.3.1

导读: 支持界面导航

以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。


目录(导读) ​


概述(中译) ​

支持界面导航


API 正文(英文) ​

funcs ​

navProjNamesReturn a list of string project names which are currently navigable based on current uiMeta flag
navRefReturn a navigation Ref for given target name and record
navResolveResolve a list of navigation Refs to a list of Dict records


def ​

func:navProjNames ​

Return a list of string project names which are currently navigable based on current uiMeta flag


meta ​

deffunc:navProjNames
isfunc
liblib:nav
namenavProjNames

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:navRef ​

Return a navigation Ref for given target name and record. The target should be a string name for the tree leafs such such "site", "equip", or "point". The record is an Ref id or Dict for the node to represent. Raise exception if the record does not match any configured level of the target path. Pass the string "all" to select the root of the navigation tree. Also see Nav.

Examples:

navRef("point", pt)      // select one point
navRef("point", equip)   // select all points contained by given equip
navRef("equip", site)    // select all equips contained by given site

meta ​

deffunc:navRef
isfunc
liblib:nav
namenavRef

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:navResolve ​

Resolve a list of navigation Refs to a list of Dict records. Also see Nav.

Default behavior is to resolve using only the local project. Pass the navCluster marker option to resolve across the cluster based on the projIncludeFilter configuration.

Navigation nesting is when a given level of the tree is organized using a reference tag. For example equip recs are nested by the equipRef tag. The default behavior of this method is to not apply nesting to compute children of of a navigation ref. However this behavior can be overridden by passing the nestExpand marker tag. This option is extremely expensive and should be avoided if at all possible (especially if combined with navCluster option). Examples:

// nested tree of equip via equipRef
eq
  eqA
    eqA1
    eqA2
  eqB

// default yields only [eq]
navRef("equip", eq).navResolve

// yields [eq, eqA, eqA1, eqA2, eqB] (eq and its nested children)
navRef("equip", eq).navResolve({nestExpand})

Note the nestExpand feature only works at the leaf level. In the example above the target name is "equip", so we can expand eq to include its nested children. However if target was "point", then we would not expand eq to include the points from eqA, eqA1, eqA2, and eqB.

Option summary:

  • kind: pass in kind value string used in input
  • navCluster: pass marker to resolve across cluster
  • nestExpand: pass marker to expand nested children (equip via equipRef)
  • itself: pass marker to resolve selection itself (not descendent targets); the behavior of this function with ancestors/groups is subject to change

meta ​

deffunc:navResolve
isfunc
liblib:nav
namenavResolve

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function