外观
lib-finDashboard 库参考
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793586849/FIN+5.3.1+lib-finDashboard 中文整理基于 FIN 5.3.1
导读: FIN 仪表板编辑器扩展
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- lib
- meta
- tags
- funcs
- def
- supertypes
- dominantValue(val, ts, acc)
- src
- finDashboardApp()
- finDashboardGenerateBinding(topTarget, relTarget, type)
- finDashboardWidgets()
- finDashboards(target: null)
概述(中译)
FIN 仪表板编辑器扩展
API 正文(英文)
tags
| finDashboard | Feature namespace of definitions formatted as feature:name |
funcs
| dominantValue | Folding function for determining the value which shows up the most in a period |
| finDashboardApp | Axon function |
| finDashboardGenerateBinding | |
| finDashboardWidgets | |
| finDashboards |
def
finDashboard
Feature namespace of definitions formatted as feature:name
meta
| def | finDashboard |
| is | feature |
| lib | lib:finDashboard |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
def
func:dominantValue
dominantValue(val, ts, acc)
Folding function for determining the value which shows up the most in a period. We assume the data is "cov"
meta
| def | func:dominantValue |
| is | func |
| lib | lib:finDashboard |
| name | dominantValue |
| overridable | ✓ |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(val, ts, acc) => do
if (val == foldStart())
return {lastTs: ts, vals: [], durs: []}
dur: ts - acc->lastTs
lastVal: acc["lastVal"]
vals: acc->vals
durs: acc->durs
ix: vals.index(lastVal)
if (ix == null) do
vals = vals.add(lastVal)
durs = durs.add(dur)
else
durs = durs.set(ix, durs[ix] + dur)
if (val == foldEnd())
vals[durs.index(durs.sort.last)]
else {
lastTs: ts,
lastVal: val,
vals: vals,
durs: durs,
}
enddef
func:finDashboardApp
finDashboardApp()
Axon function
meta
| def | func:finDashboardApp |
| finStackMobileMenu | ✓ |
| is | func |
| lib | lib:finDashboard |
| name | finDashboardApp |
| overridable | ✓ |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
() => do
[{
action: "window.app.NavigateToApp(app.APP_NAMES.DASHBOARD)",
appId: "dashboard",
displayName: toLocale("finDashboardExt::dashboard"),
hasBadge: false,
icon: "icon-meter",
iconType: "class",
level: 0,
link: "#dashboard",
order: 3,
ui: "html"
}].toGrid
enddef
func:finDashboardGenerateBinding
finDashboardGenerateBinding(topTarget, relTarget, type)
meta
| def | func:finDashboardGenerateBinding |
| is | func |
| lib | lib:finDashboard |
| name | finDashboardGenerateBinding |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finDashboardWidgets
finDashboardWidgets()
meta
| def | func:finDashboardWidgets |
| is | func |
| lib | lib:finDashboard |
| name | finDashboardWidgets |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finDashboards
finDashboards(target: null)
meta
| def | func:finDashboards |
| is | func |
| lib | lib:finDashboard |
| name | finDashboards |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |