@contraagent/ui 0.1.0 → 0.2.0
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/README.md +9 -2
- package/custom-elements.json +3300 -3098
- package/dist/adapters/check-rows.d.ts +2 -0
- package/dist/adapters/check-rows.d.ts.map +1 -1
- package/dist/adapters/check-rows.js +2 -0
- package/dist/adapters/check-rows.js.map +1 -1
- package/dist/adapters/panel-body.d.ts +15 -1
- package/dist/adapters/panel-body.d.ts.map +1 -1
- package/dist/adapters/panel-body.js +27 -0
- package/dist/adapters/panel-body.js.map +1 -1
- package/dist/contraagent-ui.js +684 -641
- package/dist/elements/lists/ca-panel-body.d.ts +16 -3
- package/dist/elements/lists/ca-panel-body.d.ts.map +1 -1
- package/dist/elements/lists/ca-panel-body.js +74 -8
- package/dist/elements/lists/ca-panel-body.js.map +1 -1
- package/dist/elements/overview/ca-overview.d.ts +2 -1
- package/dist/elements/overview/ca-overview.d.ts.map +1 -1
- package/dist/elements/overview/ca-overview.js +8 -1
- package/dist/elements/overview/ca-overview.js.map +1 -1
- package/dist/elements/overview/ca-services.d.ts +25 -0
- package/dist/elements/overview/ca-services.d.ts.map +1 -0
- package/dist/elements/overview/ca-services.js +77 -0
- package/dist/elements/overview/ca-services.js.map +1 -0
- package/dist/elements/overview/index.d.ts +1 -0
- package/dist/elements/overview/index.d.ts.map +1 -1
- package/dist/elements/overview/index.js +1 -0
- package/dist/elements/overview/index.js.map +1 -1
- package/dist/elements/shared/contract-parts.d.ts.map +1 -1
- package/dist/elements/shared/contract-parts.js +18 -2
- package/dist/elements/shared/contract-parts.js.map +1 -1
- package/dist/elements/shell/ca-monitor.d.ts +4 -2
- package/dist/elements/shell/ca-monitor.d.ts.map +1 -1
- package/dist/elements/shell/ca-monitor.js +4 -2
- package/dist/elements/shell/ca-monitor.js.map +1 -1
- package/dist/elements/task/header.d.ts.map +1 -1
- package/dist/elements/task/header.js +7 -3
- package/dist/elements/task/header.js.map +1 -1
- package/dist/locales/ja.d.ts +24 -0
- package/dist/locales/ja.d.ts.map +1 -1
- package/dist/locales/ja.js +24 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/words/changes.d.ts +2 -2
- package/dist/words/changes.d.ts.map +1 -1
- package/dist/words/changes.js +2 -0
- package/dist/words/changes.js.map +1 -1
- package/dist/words/index.d.ts +1 -0
- package/dist/words/index.d.ts.map +1 -1
- package/dist/words/index.js +1 -0
- package/dist/words/index.js.map +1 -1
- package/dist/words/panels.d.ts +6 -0
- package/dist/words/panels.d.ts.map +1 -1
- package/dist/words/panels.js +13 -0
- package/dist/words/panels.js.map +1 -1
- package/dist/words/services.d.ts +16 -0
- package/dist/words/services.d.ts.map +1 -0
- package/dist/words/services.js +45 -0
- package/dist/words/services.js.map +1 -0
- package/docs/embed.md +4 -1
- package/package.json +3 -3
- package/src/adapters/check-rows.ts +3 -0
- package/src/adapters/panel-body.ts +40 -2
- package/src/elements/lists/ca-panel-body.ts +70 -9
- package/src/elements/overview/ca-overview.ts +8 -1
- package/src/elements/overview/ca-services.ts +66 -0
- package/src/elements/overview/index.ts +1 -0
- package/src/elements/shared/contract-parts.ts +18 -2
- package/src/elements/shell/ca-monitor.ts +4 -2
- package/src/elements/task/header.ts +7 -3
- package/src/locales/ja.ts +24 -0
- package/src/words/changes.ts +4 -2
- package/src/words/index.ts +1 -0
- package/src/words/panels.ts +18 -0
- package/src/words/services.ts +57 -0
- package/dist/core/clock.d.ts +0 -20
- package/dist/core/clock.d.ts.map +0 -1
- package/dist/core/clock.js +0 -45
- package/dist/core/clock.js.map +0 -1
- package/dist/core/route.d.ts +0 -62
- package/dist/core/route.d.ts.map +0 -1
- package/dist/core/route.js +0 -143
- package/dist/core/route.js.map +0 -1
- package/dist/core/router.d.ts +0 -27
- package/dist/core/router.d.ts.map +0 -1
- package/dist/core/router.js +0 -57
- package/dist/core/router.js.map +0 -1
- package/dist/elements/lists/filters.d.ts +0 -28
- package/dist/elements/lists/filters.d.ts.map +0 -1
- package/dist/elements/lists/filters.js +0 -71
- package/dist/elements/lists/filters.js.map +0 -1
- package/dist/elements/overview/ca-pipeline-progress.d.ts +0 -17
- package/dist/elements/overview/ca-pipeline-progress.d.ts.map +0 -1
- package/dist/elements/overview/ca-pipeline-progress.js +0 -119
- package/dist/elements/overview/ca-pipeline-progress.js.map +0 -1
- package/dist/elements/overview/ca-plan-matrix.d.ts +0 -27
- package/dist/elements/overview/ca-plan-matrix.d.ts.map +0 -1
- package/dist/elements/overview/ca-plan-matrix.js +0 -113
- package/dist/elements/overview/ca-plan-matrix.js.map +0 -1
- package/dist/elements/overview/flow-types.d.ts +0 -2
- package/dist/elements/overview/flow-types.d.ts.map +0 -1
- package/dist/elements/overview/flow-types.js +0 -2
- package/dist/elements/overview/flow-types.js.map +0 -1
- package/dist/elements/overview/graph/arrange.d.ts +0 -16
- package/dist/elements/overview/graph/arrange.d.ts.map +0 -1
- package/dist/elements/overview/graph/arrange.js +0 -152
- package/dist/elements/overview/graph/arrange.js.map +0 -1
- package/dist/elements/overview/graph/card.d.ts +0 -64
- package/dist/elements/overview/graph/card.d.ts.map +0 -1
- package/dist/elements/overview/graph/card.js +0 -160
- package/dist/elements/overview/graph/card.js.map +0 -1
- package/dist/elements/overview/graph/flow-index.d.ts +0 -52
- package/dist/elements/overview/graph/flow-index.d.ts.map +0 -1
- package/dist/elements/overview/graph/flow-index.js +0 -121
- package/dist/elements/overview/graph/flow-index.js.map +0 -1
- package/dist/elements/overview/graph/highlight.d.ts +0 -14
- package/dist/elements/overview/graph/highlight.d.ts.map +0 -1
- package/dist/elements/overview/graph/highlight.js +0 -33
- package/dist/elements/overview/graph/highlight.js.map +0 -1
- package/dist/elements/overview/graph/layer.d.ts +0 -32
- package/dist/elements/overview/graph/layer.d.ts.map +0 -1
- package/dist/elements/overview/graph/layer.js +0 -92
- package/dist/elements/overview/graph/layer.js.map +0 -1
- package/dist/elements/overview/graph/layout.d.ts +0 -80
- package/dist/elements/overview/graph/layout.d.ts.map +0 -1
- package/dist/elements/overview/graph/layout.js +0 -261
- package/dist/elements/overview/graph/layout.js.map +0 -1
- package/dist/elements/overview/graph/marks.d.ts +0 -18
- package/dist/elements/overview/graph/marks.d.ts.map +0 -1
- package/dist/elements/overview/graph/marks.js +0 -17
- package/dist/elements/overview/graph/marks.js.map +0 -1
- package/dist/elements/overview/graph/matrix.d.ts +0 -58
- package/dist/elements/overview/graph/matrix.d.ts.map +0 -1
- package/dist/elements/overview/graph/matrix.js +0 -93
- package/dist/elements/overview/graph/matrix.js.map +0 -1
- package/dist/elements/overview/graph/nav.d.ts +0 -15
- package/dist/elements/overview/graph/nav.d.ts.map +0 -1
- package/dist/elements/overview/graph/nav.js +0 -80
- package/dist/elements/overview/graph/nav.js.map +0 -1
- package/dist/elements/overview/graph/pan-zoom.d.ts +0 -83
- package/dist/elements/overview/graph/pan-zoom.d.ts.map +0 -1
- package/dist/elements/overview/graph/pan-zoom.js +0 -189
- package/dist/elements/overview/graph/pan-zoom.js.map +0 -1
- package/dist/elements/overview/graph/paths.d.ts +0 -9
- package/dist/elements/overview/graph/paths.d.ts.map +0 -1
- package/dist/elements/overview/graph/paths.js +0 -44
- package/dist/elements/overview/graph/paths.js.map +0 -1
- package/dist/elements/overview/graph/place-card.d.ts +0 -36
- package/dist/elements/overview/graph/place-card.d.ts.map +0 -1
- package/dist/elements/overview/graph/place-card.js +0 -68
- package/dist/elements/overview/graph/place-card.js.map +0 -1
- package/dist/elements/overview/graph/project.d.ts +0 -31
- package/dist/elements/overview/graph/project.d.ts.map +0 -1
- package/dist/elements/overview/graph/project.js +0 -455
- package/dist/elements/overview/graph/project.js.map +0 -1
- package/dist/elements/overview/graph/selection.d.ts +0 -31
- package/dist/elements/overview/graph/selection.d.ts.map +0 -1
- package/dist/elements/overview/graph/selection.js +0 -44
- package/dist/elements/overview/graph/selection.js.map +0 -1
- package/dist/elements/overview/graph/states.d.ts +0 -6
- package/dist/elements/overview/graph/states.d.ts.map +0 -1
- package/dist/elements/overview/graph/states.js +0 -5
- package/dist/elements/overview/graph/states.js.map +0 -1
- package/dist/elements/overview/graph/types.d.ts +0 -124
- package/dist/elements/overview/graph/types.d.ts.map +0 -1
- package/dist/elements/overview/graph/types.js +0 -3
- package/dist/elements/overview/graph/types.js.map +0 -1
- package/dist/elements/overview/graph/view.d.ts +0 -16
- package/dist/elements/overview/graph/view.d.ts.map +0 -1
- package/dist/elements/overview/graph/view.js +0 -20
- package/dist/elements/overview/graph/view.js.map +0 -1
- package/dist/elements/overview/kpis-model.d.ts +0 -31
- package/dist/elements/overview/kpis-model.d.ts.map +0 -1
- package/dist/elements/overview/kpis-model.js +0 -30
- package/dist/elements/overview/kpis-model.js.map +0 -1
- package/dist/elements/overview/logic.d.ts +0 -442
- package/dist/elements/overview/logic.d.ts.map +0 -1
- package/dist/elements/overview/logic.js +0 -1431
- package/dist/elements/overview/logic.js.map +0 -1
- package/dist/elements/overview/pipeline-graph/dag.d.ts +0 -4
- package/dist/elements/overview/pipeline-graph/dag.d.ts.map +0 -1
- package/dist/elements/overview/pipeline-graph/dag.js +0 -259
- package/dist/elements/overview/pipeline-graph/dag.js.map +0 -1
- package/dist/elements/overview/pipeline-graph/icons.d.ts +0 -5
- package/dist/elements/overview/pipeline-graph/icons.d.ts.map +0 -1
- package/dist/elements/overview/pipeline-graph/icons.js +0 -13
- package/dist/elements/overview/pipeline-graph/icons.js.map +0 -1
- package/dist/elements/overview/pipeline-graph/legend.d.ts +0 -9
- package/dist/elements/overview/pipeline-graph/legend.d.ts.map +0 -1
- package/dist/elements/overview/pipeline-graph/legend.js +0 -59
- package/dist/elements/overview/pipeline-graph/legend.js.map +0 -1
- package/dist/elements/overview/pipeline-graph/matrix.d.ts +0 -4
- package/dist/elements/overview/pipeline-graph/matrix.d.ts.map +0 -1
- package/dist/elements/overview/pipeline-graph/matrix.js +0 -193
- package/dist/elements/overview/pipeline-graph/matrix.js.map +0 -1
- package/dist/elements/overview/pipeline-graph/table.d.ts +0 -11
- package/dist/elements/overview/pipeline-graph/table.d.ts.map +0 -1
- package/dist/elements/overview/pipeline-graph/table.js +0 -74
- package/dist/elements/overview/pipeline-graph/table.js.map +0 -1
- package/dist/elements/overview/pipeline-graph/tools.d.ts +0 -5
- package/dist/elements/overview/pipeline-graph/tools.d.ts.map +0 -1
- package/dist/elements/overview/pipeline-graph/tools.js +0 -48
- package/dist/elements/overview/pipeline-graph/tools.js.map +0 -1
- package/dist/elements/overview/pipeline-graph/words.d.ts +0 -45
- package/dist/elements/overview/pipeline-graph/words.d.ts.map +0 -1
- package/dist/elements/overview/pipeline-graph/words.js +0 -108
- package/dist/elements/overview/pipeline-graph/words.js.map +0 -1
- package/dist/elements/overview/place-card.d.ts +0 -36
- package/dist/elements/overview/place-card.d.ts.map +0 -1
- package/dist/elements/overview/place-card.js +0 -68
- package/dist/elements/overview/place-card.js.map +0 -1
- package/dist/elements/overview/timeline-model.d.ts +0 -44
- package/dist/elements/overview/timeline-model.d.ts.map +0 -1
- package/dist/elements/overview/timeline-model.js +0 -53
- package/dist/elements/overview/timeline-model.js.map +0 -1
- package/dist/elements/shared/ca-count.d.ts +0 -17
- package/dist/elements/shared/ca-count.d.ts.map +0 -1
- package/dist/elements/shared/ca-count.js +0 -59
- package/dist/elements/shared/ca-count.js.map +0 -1
- package/dist/elements/shared/ca-elapsed.d.ts +0 -14
- package/dist/elements/shared/ca-elapsed.d.ts.map +0 -1
- package/dist/elements/shared/ca-elapsed.js +0 -33
- package/dist/elements/shared/ca-elapsed.js.map +0 -1
- package/dist/elements/shared/ca-json-tree.d.ts +0 -16
- package/dist/elements/shared/ca-json-tree.d.ts.map +0 -1
- package/dist/elements/shared/ca-json-tree.js +0 -52
- package/dist/elements/shared/ca-json-tree.js.map +0 -1
- package/dist/elements/shared/ca-markdown.d.ts +0 -19
- package/dist/elements/shared/ca-markdown.d.ts.map +0 -1
- package/dist/elements/shared/ca-markdown.js +0 -59
- package/dist/elements/shared/ca-markdown.js.map +0 -1
- package/dist/elements/shared/fact-line.d.ts +0 -4
- package/dist/elements/shared/fact-line.d.ts.map +0 -1
- package/dist/elements/shared/fact-line.js +0 -8
- package/dist/elements/shared/fact-line.js.map +0 -1
- package/dist/elements/task/rounds.d.ts +0 -14
- package/dist/elements/task/rounds.d.ts.map +0 -1
- package/dist/elements/task/rounds.js +0 -59
- package/dist/elements/task/rounds.js.map +0 -1
- package/dist/elements/task/transcript-model.d.ts +0 -106
- package/dist/elements/task/transcript-model.d.ts.map +0 -1
- package/dist/elements/task/transcript-model.js +0 -280
- package/dist/elements/task/transcript-model.js.map +0 -1
- package/dist/elements/task/who.d.ts +0 -5
- package/dist/elements/task/who.d.ts.map +0 -1
- package/dist/elements/task/who.js +0 -30
- package/dist/elements/task/who.js.map +0 -1
- package/dist/events.d.ts +0 -107
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -5
- package/dist/events.js.map +0 -1
- package/dist/i18n.d.ts +0 -16
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js +0 -48
- package/dist/i18n.js.map +0 -1
- package/dist/lib/clock.d.ts +0 -20
- package/dist/lib/clock.d.ts.map +0 -1
- package/dist/lib/clock.js +0 -45
- package/dist/lib/clock.js.map +0 -1
- package/dist/lib/format.d.ts +0 -35
- package/dist/lib/format.d.ts.map +0 -1
- package/dist/lib/format.js +0 -117
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/highlight.d.ts +0 -5
- package/dist/lib/highlight.d.ts.map +0 -1
- package/dist/lib/highlight.js +0 -86
- package/dist/lib/highlight.js.map +0 -1
- package/dist/lib/labels.d.ts +0 -103
- package/dist/lib/labels.d.ts.map +0 -1
- package/dist/lib/labels.js +0 -249
- package/dist/lib/labels.js.map +0 -1
- package/dist/lib/markdown.d.ts +0 -13
- package/dist/lib/markdown.d.ts.map +0 -1
- package/dist/lib/markdown.js +0 -118
- package/dist/lib/markdown.js.map +0 -1
- package/dist/lib/memory.d.ts +0 -27
- package/dist/lib/memory.d.ts.map +0 -1
- package/dist/lib/memory.js +0 -117
- package/dist/lib/memory.js.map +0 -1
- package/dist/lib/quota-format.d.ts +0 -28
- package/dist/lib/quota-format.d.ts.map +0 -1
- package/dist/lib/quota-format.js +0 -67
- package/dist/lib/quota-format.js.map +0 -1
- package/dist/lib/scroll.d.ts +0 -16
- package/dist/lib/scroll.d.ts.map +0 -1
- package/dist/lib/scroll.js +0 -70
- package/dist/lib/scroll.js.map +0 -1
- package/dist/lib/status.d.ts +0 -25
- package/dist/lib/status.d.ts.map +0 -1
- package/dist/lib/status.js +0 -40
- package/dist/lib/status.js.map +0 -1
- package/dist/route.d.ts +0 -46
- package/dist/route.d.ts.map +0 -1
- package/dist/route.js +0 -102
- package/dist/route.js.map +0 -1
- package/dist/router.d.ts +0 -23
- package/dist/router.d.ts.map +0 -1
- package/dist/router.js +0 -55
- package/dist/router.js.map +0 -1
- package/dist/styles/base.d.ts +0 -11
- package/dist/styles/base.d.ts.map +0 -1
- package/dist/styles/base.js +0 -241
- package/dist/styles/base.js.map +0 -1
- package/dist/styles/chips.d.ts +0 -2
- package/dist/styles/chips.d.ts.map +0 -1
- package/dist/styles/chips.js +0 -18
- package/dist/styles/chips.js.map +0 -1
- package/dist/styles/executor-icon.d.ts +0 -3
- package/dist/styles/executor-icon.d.ts.map +0 -1
- package/dist/styles/executor-icon.js +0 -9
- package/dist/styles/executor-icon.js.map +0 -1
- package/dist/styles/facts.d.ts +0 -2
- package/dist/styles/facts.d.ts.map +0 -1
- package/dist/styles/facts.js +0 -7
- package/dist/styles/facts.js.map +0 -1
- package/dist/styles/index.d.ts +0 -17
- package/dist/styles/index.d.ts.map +0 -1
- package/dist/styles/index.js +0 -16
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/layout.d.ts +0 -2
- package/dist/styles/layout.d.ts.map +0 -1
- package/dist/styles/layout.js +0 -30
- package/dist/styles/layout.js.map +0 -1
- package/dist/styles/legend.d.ts +0 -2
- package/dist/styles/legend.d.ts.map +0 -1
- package/dist/styles/legend.js +0 -8
- package/dist/styles/legend.js.map +0 -1
- package/dist/styles/meter.d.ts +0 -3
- package/dist/styles/meter.d.ts.map +0 -1
- package/dist/styles/meter.js +0 -9
- package/dist/styles/meter.js.map +0 -1
- package/dist/styles/motion.d.ts +0 -2
- package/dist/styles/motion.d.ts.map +0 -1
- package/dist/styles/motion.js +0 -27
- package/dist/styles/motion.js.map +0 -1
- package/dist/styles/prose.d.ts +0 -3
- package/dist/styles/prose.d.ts.map +0 -1
- package/dist/styles/prose.js +0 -59
- package/dist/styles/prose.js.map +0 -1
- package/dist/styles/reset.d.ts +0 -2
- package/dist/styles/reset.d.ts.map +0 -1
- package/dist/styles/reset.js +0 -13
- package/dist/styles/reset.js.map +0 -1
- package/dist/styles/status.d.ts +0 -2
- package/dist/styles/status.d.ts.map +0 -1
- package/dist/styles/status.js +0 -52
- package/dist/styles/status.js.map +0 -1
- package/dist/styles/text.d.ts +0 -2
- package/dist/styles/text.d.ts.map +0 -1
- package/dist/styles/text.js +0 -21
- package/dist/styles/text.js.map +0 -1
- package/dist/styles/theme-sheet.d.ts +0 -12
- package/dist/styles/theme-sheet.d.ts.map +0 -1
- package/dist/styles/theme-sheet.js +0 -24
- package/dist/styles/theme-sheet.js.map +0 -1
- package/dist/styles/themes.d.ts +0 -75
- package/dist/styles/themes.d.ts.map +0 -1
- package/dist/styles/themes.js +0 -452
- package/dist/styles/themes.js.map +0 -1
- package/dist/styles/tokens.d.ts +0 -8
- package/dist/styles/tokens.d.ts.map +0 -1
- package/dist/styles/tokens.js +0 -32
- package/dist/styles/tokens.js.map +0 -1
- package/dist/themes/boot.d.ts +0 -7
- package/dist/themes/boot.d.ts.map +0 -1
- package/dist/themes/boot.js +0 -14
- package/dist/themes/boot.js.map +0 -1
- package/dist/themes/choice.d.ts +0 -16
- package/dist/themes/choice.d.ts.map +0 -1
- package/dist/themes/choice.js +0 -45
- package/dist/themes/choice.js.map +0 -1
- package/dist/themes/data.d.ts +0 -42
- package/dist/themes/data.d.ts.map +0 -1
- package/dist/themes/data.js +0 -356
- package/dist/themes/data.js.map +0 -1
- package/dist/themes/index.d.ts +0 -5
- package/dist/themes/index.d.ts.map +0 -1
- package/dist/themes/index.js +0 -8
- package/dist/themes/index.js.map +0 -1
- package/dist/themes/sheet.d.ts +0 -12
- package/dist/themes/sheet.d.ts.map +0 -1
- package/dist/themes/sheet.js +0 -24
- package/dist/themes/sheet.js.map +0 -1
- package/dist/themes/tokens-list.d.ts +0 -15
- package/dist/themes/tokens-list.d.ts.map +0 -1
- package/dist/themes/tokens-list.js +0 -62
- package/dist/themes/tokens-list.js.map +0 -1
- package/dist/words/units.d.ts +0 -9
- package/dist/words/units.d.ts.map +0 -1
- package/dist/words/units.js +0 -12
- package/dist/words/units.js.map +0 -1
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// The plan as the graph reads it: each task's flow path, its loops and passes, its
|
|
2
|
-
// flow call, and where it is shown at a depth of the flow path.
|
|
3
|
-
// A plan node's origin (`flow`, `created_from`, `flow_call`) is optional on the
|
|
4
|
-
// wire (absent for a task no flow created), so the readers here check it before use.
|
|
5
|
-
import {} from '@contraagent/api';
|
|
6
|
-
import { LOOP_SEGMENT } from './types.js';
|
|
7
|
-
const isStr = (x) => typeof x === 'string';
|
|
8
|
-
function readFrames(n) {
|
|
9
|
-
const f = n.flow;
|
|
10
|
-
if (!Array.isArray(f))
|
|
11
|
-
return [];
|
|
12
|
-
const out = [];
|
|
13
|
-
for (const x of f) {
|
|
14
|
-
const r = x;
|
|
15
|
-
if (!r || typeof r !== 'object' || !isStr(r.function))
|
|
16
|
-
break;
|
|
17
|
-
const read = (Array.isArray(r.loops) ? r.loops : []).filter((l) => !!l && typeof l.line === 'number');
|
|
18
|
-
out.push({
|
|
19
|
-
function: r.function,
|
|
20
|
-
file: isStr(r.file) ? r.file : '',
|
|
21
|
-
line: typeof r.line === 'number' ? r.line : 0,
|
|
22
|
-
loops: read.map((l) => l.line),
|
|
23
|
-
// A pass not counted (null) reads as the first.
|
|
24
|
-
passes: read.map((l) => (typeof l.pass === 'number' && l.pass >= 1 ? l.pass : 1)),
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return out;
|
|
28
|
-
}
|
|
29
|
-
function readCalls(plan) {
|
|
30
|
-
const cs = plan.flow_calls;
|
|
31
|
-
if (!Array.isArray(cs) || cs.length === 0)
|
|
32
|
-
return null; // no flow call recorded
|
|
33
|
-
return new Map(cs.filter((c) => c && isStr(c.id) && isStr(c.function)).map((c) => [c.id, c]));
|
|
34
|
-
}
|
|
35
|
-
const indexes = new WeakMap();
|
|
36
|
-
export function indexOf(plan) {
|
|
37
|
-
const had = indexes.get(plan);
|
|
38
|
-
if (had)
|
|
39
|
-
return had;
|
|
40
|
-
const tasks = plan.nodes.map((n) => {
|
|
41
|
-
const frames = readFrames(n);
|
|
42
|
-
const from = n.created_from;
|
|
43
|
-
return {
|
|
44
|
-
n,
|
|
45
|
-
frames,
|
|
46
|
-
path: frames.map((f) => f.function),
|
|
47
|
-
from: Array.isArray(from) ? from.filter(isStr) : [],
|
|
48
|
-
call: isStr(n.flow_call) ? n.flow_call : '',
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
const unitRank = new Map();
|
|
52
|
-
for (const n of plan.nodes)
|
|
53
|
-
if (n.unit && !unitRank.has(n.unit))
|
|
54
|
-
unitRank.set(n.unit, unitRank.size);
|
|
55
|
-
const ix = {
|
|
56
|
-
tasks,
|
|
57
|
-
byKey: new Map(tasks.map((t) => [t.n.key, t])),
|
|
58
|
-
calls: readCalls(plan),
|
|
59
|
-
unitRank,
|
|
60
|
-
labels: new Map(plan.groups.map((g) => [g.id, g.label])),
|
|
61
|
-
};
|
|
62
|
-
indexes.set(plan, ix);
|
|
63
|
-
return ix;
|
|
64
|
-
}
|
|
65
|
-
export const startsWith = (path, prefix) => prefix.every((p, i) => path[i] === p);
|
|
66
|
-
/** A function's name without its module. */
|
|
67
|
-
export const shortName = (fn) => fn.slice(fn.lastIndexOf('.') + 1) || fn;
|
|
68
|
-
/** The loops around a task's call site at depth `d`, outermost first ([] outside any). */
|
|
69
|
-
export const loopsAt = (t, d) => (d > 0 ? (t.frames[d - 1]?.loops ?? []) : []);
|
|
70
|
-
/** The pass of each of those loops, outermost first: the task's place in them. */
|
|
71
|
-
export const passesAt = (t, d) => (d > 0 ? (t.frames[d - 1]?.passes ?? []) : []);
|
|
72
|
-
/** Two pass lists in the order the passes ran: the outer loop's first. */
|
|
73
|
-
export function cmpPasses(a, b) {
|
|
74
|
-
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
|
75
|
-
const d = (a[i] ?? 0) - (b[i] ?? 0);
|
|
76
|
-
if (d)
|
|
77
|
-
return d;
|
|
78
|
-
}
|
|
79
|
-
return 0;
|
|
80
|
-
}
|
|
81
|
-
/** The loop box ids for a loop chain, outermost first: `loop:7`, then `loop:7.9`, ... */
|
|
82
|
-
export const boxChain = (loops) => loops.map((_, i) => `${LOOP_SEGMENT}${loops.slice(0, i + 1).join('.')}`);
|
|
83
|
-
/** Where a task is shown at depth `d`: its kind node, or the node of the function it was created under. */
|
|
84
|
-
export function placeOf(t, d) {
|
|
85
|
-
const loops = loopsAt(t, d);
|
|
86
|
-
const at = loops.length ? `@${loops.join('.')}` : '';
|
|
87
|
-
if (t.path.length <= d)
|
|
88
|
-
return { id: `kind:${t.n.group}${at}`, type: 'kind', name: t.n.group, loops };
|
|
89
|
-
const name = t.path[d];
|
|
90
|
-
return { id: `flow:${name}${at}`, type: 'flow', name, loops };
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* The flow call a function node stands for, for a task at depth `d`: the call that
|
|
94
|
-
* started at frame `d` (`own`), else the call the frame runs in (`yield from`). With
|
|
95
|
-
* no flow calls in the plan, each frame of the task's call chain is taken to start one.
|
|
96
|
-
*/
|
|
97
|
-
export function instanceOf(t, d, calls) {
|
|
98
|
-
if (!t.call)
|
|
99
|
-
return { id: `>${d}`, own: false };
|
|
100
|
-
const parts = t.call.split('.');
|
|
101
|
-
const chain = parts.map((_, i) => parts.slice(0, i + 1).join('.'));
|
|
102
|
-
let owner = 0;
|
|
103
|
-
let start = 0;
|
|
104
|
-
if (calls) {
|
|
105
|
-
for (let j = 1; j < chain.length; j++) {
|
|
106
|
-
const fn = calls.get(chain[j])?.function;
|
|
107
|
-
const idx = fn === undefined ? -1 : t.frames.findIndex((f, i) => i > start && f.function === fn);
|
|
108
|
-
if (idx < 0 || idx > d)
|
|
109
|
-
break;
|
|
110
|
-
owner = j;
|
|
111
|
-
start = idx;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
owner = Math.min(d, chain.length - 1);
|
|
116
|
-
start = owner;
|
|
117
|
-
}
|
|
118
|
-
const id = chain[owner];
|
|
119
|
-
return start === d ? { id, own: true } : { id: `${id}>${d}`, own: false };
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=flow-index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow-index.js","sourceRoot":"","sources":["../../../../src/elements/overview/graph/flow-index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,gEAAgE;AAChE,gFAAgF;AAChF,qFAAqF;AACrF,OAAO,EAA8E,MAAM,kBAAkB,CAAC;AAC9G,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA2B1C,MAAM,KAAK,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;AAEjE,SAAS,UAAU,CAAC,CAAW;IAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,IAAe,CAAC;IAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,MAAM,GAAG,GAAgB,EAAE,CAAC;IAC5B,KAAK,MAAM,CAAC,IAAI,CAAc,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,CAA8B,CAAC;QACzC,IAAI,CAAC,CAAC,IAAI,OA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AAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC,EAAE,QAAQ,CAAC;YACnD,MAAM,GAAG,GAAG,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,QAAQ,KAAK,EAAE,CAAC,CAAC;YACjG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC;gBAAE,MAAM;YAC9B,KAAK,GAAG,CAAC,CAAC;YACV,KAAK,GAAG,GAAG,CAAC;QACd,CAAC;IACH,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACtC,KAAK,GAAG,KAAK,CAAC;IAChB,CAAC;IACD,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAW,CAAC;IAClC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { PlanNode } from '@contraagent/api';
|
|
2
|
-
/** The plan's tasks by key, and the tasks that wait for each task. */
|
|
3
|
-
export interface TaskLinks {
|
|
4
|
-
byKey: ReadonlyMap<string, PlanNode>;
|
|
5
|
-
waiters: ReadonlyMap<string, readonly string[]>;
|
|
6
|
-
}
|
|
7
|
-
export declare function taskLinks(nodes: readonly PlanNode[]): TaskLinks;
|
|
8
|
-
/**
|
|
9
|
-
* The tasks to highlight for `hl` (a unit, or the key of a task without one): the
|
|
10
|
-
* unit's own, and every task joined to them upstream or downstream (a task without a
|
|
11
|
-
* unit, another unit's).
|
|
12
|
-
*/
|
|
13
|
-
export declare function related(nodes: readonly PlanNode[], links: TaskLinks, hl: string): Set<string>;
|
|
14
|
-
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../src/elements/overview/graph/highlight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CACjD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,CAI/D;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAkB7F"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export function taskLinks(nodes) {
|
|
2
|
-
const waiters = new Map();
|
|
3
|
-
for (const n of nodes)
|
|
4
|
-
for (const d of n.after ?? [])
|
|
5
|
-
(waiters.get(d) ?? waiters.set(d, []).get(d))?.push(n.key);
|
|
6
|
-
return { byKey: new Map(nodes.map((n) => [n.key, n])), waiters };
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The tasks to highlight for `hl` (a unit, or the key of a task without one): the
|
|
10
|
-
* unit's own, and every task joined to them upstream or downstream (a task without a
|
|
11
|
-
* unit, another unit's).
|
|
12
|
-
*/
|
|
13
|
-
export function related(nodes, links, hl) {
|
|
14
|
-
const seeds = nodes.filter((n) => (n.unit ? n.unit === hl : n.key === hl)).map((n) => n.key);
|
|
15
|
-
const on = new Set(seeds);
|
|
16
|
-
const walk = (next) => {
|
|
17
|
-
const seen = new Set(seeds);
|
|
18
|
-
const queue = [...seeds];
|
|
19
|
-
for (let k = queue.pop(); k !== undefined; k = queue.pop()) {
|
|
20
|
-
for (const x of next(k)) {
|
|
21
|
-
if (seen.has(x))
|
|
22
|
-
continue;
|
|
23
|
-
seen.add(x);
|
|
24
|
-
on.add(x);
|
|
25
|
-
queue.push(x);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
walk((k) => links.waiters.get(k) ?? []);
|
|
30
|
-
walk((k) => links.byKey.get(k)?.after ?? []);
|
|
31
|
-
return on;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=highlight.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"highlight.js","sourceRoot":"","sources":["../../../../src/elements/overview/graph/highlight.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,SAAS,CAAC,KAA0B;IAClD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC5C,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE;YAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjH,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,KAA0B,EAAE,KAAgB,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AC7C,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Plan } from '@contraagent/api';
|
|
2
|
-
import { type LayerGraph, type LayerOrder } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* The layer `path` of the plan's flow. Pass the `order` of the last graph of this layer as
|
|
5
|
-
* `prev` to keep its nodes in place; `down` routes the edges for a drawing top to bottom
|
|
6
|
-
* (a box's label is then on the side its edges come in).
|
|
7
|
-
*/
|
|
8
|
-
export declare function layerGraph(plan: Plan, path?: readonly string[], prev?: LayerOrder, down?: boolean): LayerGraph;
|
|
9
|
-
/**
|
|
10
|
-
* The layer the graph opens on: from the top, down while a layer has a single
|
|
11
|
-
* node and it is a function's. It stops at a single function node whose flow call
|
|
12
|
-
* raised or was closed, so a run that failed inside a flow opens on the node that
|
|
13
|
-
* shows it, not inside it. A failed or not started task does not stop it: the layer
|
|
14
|
-
* below shows that task's own mark. A static flow lands on its kinds.
|
|
15
|
-
*/
|
|
16
|
-
export declare function autoLayer(plan: Plan): string[];
|
|
17
|
-
/** A layer's segments: its path, and the loop box entered at its end (null when none). */
|
|
18
|
-
export declare function splitLayer(segments: readonly string[]): {
|
|
19
|
-
path: string[];
|
|
20
|
-
loop: string | null;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* The layer `segments` names, as the plan has it: the segments themselves when the
|
|
24
|
-
* plan has that layer (a prefix of a task's flow path, and the loop box after it);
|
|
25
|
-
* else, when the last function is named by its `module.qualname` (or, failing that,
|
|
26
|
-
* its name) and the plan reaches it by one flow path only, that flow path, with the
|
|
27
|
-
* loop box when the layer there has it. Null when the plan has no such layer.
|
|
28
|
-
*/
|
|
29
|
-
export declare function resolveLayer(plan: Plan, segments: readonly string[]): string[] | null;
|
|
30
|
-
/** One level up from `segments`: null at the top (the layer the graph opens on, `auto`), [] for that layer. */
|
|
31
|
-
export declare function parentLayer(segments: readonly string[], auto: readonly string[]): string[] | null;
|
|
32
|
-
//# sourceMappingURL=layer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../../../src/elements/overview/graph/layer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,UAAQ,GAAG,UAAU,CAEhH;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CA4B9C;AAED,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAG/F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAgBrF;AAED,+GAA+G;AAC/G,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAIjG"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { indexOf, instanceOf, placeOf, shortName, startsWith } from './flow-index.js';
|
|
2
|
-
import { project } from './project.js';
|
|
3
|
-
import { LOOP_SEGMENT } from './types.js';
|
|
4
|
-
/**
|
|
5
|
-
* The layer `path` of the plan's flow. Pass the `order` of the last graph of this layer as
|
|
6
|
-
* `prev` to keep its nodes in place; `down` routes the edges for a drawing top to bottom
|
|
7
|
-
* (a box's label is then on the side its edges come in).
|
|
8
|
-
*/
|
|
9
|
-
export function layerGraph(plan, path = [], prev, down = false) {
|
|
10
|
-
return project(plan, path, prev, down).graph;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The layer the graph opens on: from the top, down while a layer has a single
|
|
14
|
-
* node and it is a function's. It stops at a single function node whose flow call
|
|
15
|
-
* raised or was closed, so a run that failed inside a flow opens on the node that
|
|
16
|
-
* shows it, not inside it. A failed or not started task does not stop it: the layer
|
|
17
|
-
* below shows that task's own mark. A static flow lands on its kinds.
|
|
18
|
-
*/
|
|
19
|
-
export function autoLayer(plan) {
|
|
20
|
-
const ix = indexOf(plan);
|
|
21
|
-
const path = [];
|
|
22
|
-
// The failure sites: flow calls that raised or were closed with no raised descendant.
|
|
23
|
-
// The graph stops on the node that shows one, not inside it. A plan with no flow calls
|
|
24
|
-
// cannot tell its failure sites, so it descends as if there were none.
|
|
25
|
-
const raised = new Set();
|
|
26
|
-
if (ix.calls)
|
|
27
|
-
for (const c of ix.calls.values())
|
|
28
|
-
if (c.state === 'raised' || c.state === 'closed')
|
|
29
|
-
raised.add(c.id);
|
|
30
|
-
const isSite = (id) => raised.has(id) && ![...raised].some((r) => r !== id && r.startsWith(`${id}.`));
|
|
31
|
-
for (;;) {
|
|
32
|
-
let only = null;
|
|
33
|
-
let one = true;
|
|
34
|
-
const mine = [];
|
|
35
|
-
for (const t of ix.tasks) {
|
|
36
|
-
if (!startsWith(t.path, path))
|
|
37
|
-
continue;
|
|
38
|
-
const p = placeOf(t, path.length);
|
|
39
|
-
if (p.type === 'kind' || (only && only.id !== p.id)) {
|
|
40
|
-
one = false;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
only = p;
|
|
44
|
-
mine.push(t);
|
|
45
|
-
}
|
|
46
|
-
// Stop before entering a single function node that is itself a failure site.
|
|
47
|
-
const atSite = mine.some((t) => isSite(instanceOf(t, path.length, ix.calls).id));
|
|
48
|
-
if (!one || !only || atSite)
|
|
49
|
-
return path;
|
|
50
|
-
path.push(only.name);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/** A layer's segments: its path, and the loop box entered at its end (null when none). */
|
|
54
|
-
export function splitLayer(segments) {
|
|
55
|
-
const last = segments[segments.length - 1];
|
|
56
|
-
return last?.startsWith(LOOP_SEGMENT) ? { path: segments.slice(0, -1), loop: last } : { path: [...segments], loop: null };
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* The layer `segments` names, as the plan has it: the segments themselves when the
|
|
60
|
-
* plan has that layer (a prefix of a task's flow path, and the loop box after it);
|
|
61
|
-
* else, when the last function is named by its `module.qualname` (or, failing that,
|
|
62
|
-
* its name) and the plan reaches it by one flow path only, that flow path, with the
|
|
63
|
-
* loop box when the layer there has it. Null when the plan has no such layer.
|
|
64
|
-
*/
|
|
65
|
-
export function resolveLayer(plan, segments) {
|
|
66
|
-
const { path, loop } = splitLayer(segments);
|
|
67
|
-
const ix = indexOf(plan);
|
|
68
|
-
const hasLoop = (p) => !loop || layerGraph(plan, p).boxes.some((b) => b.id === loop);
|
|
69
|
-
if (ix.tasks.some((t) => startsWith(t.path, path)))
|
|
70
|
-
return hasLoop(path) ? [...segments] : null;
|
|
71
|
-
const name = path[path.length - 1];
|
|
72
|
-
if (name === undefined)
|
|
73
|
-
return null;
|
|
74
|
-
const found = (match) => {
|
|
75
|
-
const by = new Map();
|
|
76
|
-
for (const t of ix.tasks)
|
|
77
|
-
t.path.forEach((fn, i) => match(fn) && by.set(t.path.slice(0, i + 1).join('/'), t.path.slice(0, i + 1)));
|
|
78
|
-
return [...by.values()];
|
|
79
|
-
};
|
|
80
|
-
const exact = found((fn) => fn === name);
|
|
81
|
-
const named = exact.length ? exact : found((fn) => shortName(fn) === name);
|
|
82
|
-
const only = named.length === 1 ? named[0] : null;
|
|
83
|
-
return only && hasLoop(only) ? (loop ? [...only, loop] : only) : null;
|
|
84
|
-
}
|
|
85
|
-
/** One level up from `segments`: null at the top (the layer the graph opens on, `auto`), [] for that layer. */
|
|
86
|
-
export function parentLayer(segments, auto) {
|
|
87
|
-
if (segments.length <= auto.length)
|
|
88
|
-
return null;
|
|
89
|
-
const up = segments.slice(0, -1);
|
|
90
|
-
return up.length <= auto.length ? [] : up;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=layer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layer.js","sourceRoot":"","sources":["../../../../src/elements/overview/graph/layer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAiB,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAoC,MAAM,YAAY,CAAC;AAE5E;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,OAA0B,EAAE,EAAE,IAAiB,EAAE,IAAI,GAAG,KAAK;IAClG,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,IAAU;IAClC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,sFAAsF;IACtF,uFAAuF;IACvF,uEAAuE;IACvE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,IAAI,EAAE,CAAC,KAAK;QAAE,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE;YAAE,IAAI,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,KAAK,QAAQ;gBAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;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MAAM,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAChD,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { LayerGraph } from './types.js';
|
|
2
|
-
export interface Size {
|
|
3
|
-
w: number;
|
|
4
|
-
h: number;
|
|
5
|
-
}
|
|
6
|
-
/** A rectangle in the drawing. */
|
|
7
|
-
export interface Rect {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
w: number;
|
|
11
|
-
h: number;
|
|
12
|
-
}
|
|
13
|
-
/** A straight stretch of an edge along the flow, from `a` to `b`, `at` across it; an edge bends between two. */
|
|
14
|
-
export interface Run {
|
|
15
|
-
a: number;
|
|
16
|
-
b: number;
|
|
17
|
-
at: number;
|
|
18
|
-
}
|
|
19
|
-
export interface GraphLayout {
|
|
20
|
-
/** The drawing's size, its margin included. */
|
|
21
|
-
w: number;
|
|
22
|
-
h: number;
|
|
23
|
-
/** Every node, stub and loop box, by id. */
|
|
24
|
-
at: Record<string, Rect>;
|
|
25
|
-
/** Every route, with its runs. */
|
|
26
|
-
edges: {
|
|
27
|
-
from: string;
|
|
28
|
-
to: string;
|
|
29
|
-
type: 'after' | 'created';
|
|
30
|
-
runs: Run[];
|
|
31
|
-
}[];
|
|
32
|
-
/** Each loop box's return to its next pass. */
|
|
33
|
-
returns: LoopReturn[];
|
|
34
|
-
down: boolean;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* A loop box's return to its next pass, along the flow (`u`) and across it (`v`): from
|
|
38
|
-
* the far side of its last layer's outermost item (`from`, at `v0`) out to a band
|
|
39
|
-
* past its content (`band`), back along the band, and in to its first layer's
|
|
40
|
-
* outermost item (`to`, at `v1`). Left to right the band is under the nodes; top to
|
|
41
|
-
* bottom, on their right.
|
|
42
|
-
*/
|
|
43
|
-
export interface LoopReturn {
|
|
44
|
-
box: string;
|
|
45
|
-
from: number;
|
|
46
|
-
v0: number;
|
|
47
|
-
to: number;
|
|
48
|
-
v1: number;
|
|
49
|
-
band: number;
|
|
50
|
-
}
|
|
51
|
-
/** The spaces of a drawing; left to right unless `down`. */
|
|
52
|
-
export interface LayoutSpace {
|
|
53
|
-
/** Between two layers, at the top level and in a loop box. */
|
|
54
|
-
gap: number;
|
|
55
|
-
boxGap: number;
|
|
56
|
-
/** Between two items of a layer, and next to a point an edge passes. */
|
|
57
|
-
sep: number;
|
|
58
|
-
pointSep: number;
|
|
59
|
-
/** A loop box's padding, and the space under its label. */
|
|
60
|
-
pad: number;
|
|
61
|
-
/** The space after a box's content, across the flow: the band its return to the next pass runs in. */
|
|
62
|
-
padEnd: number;
|
|
63
|
-
margin: number;
|
|
64
|
-
}
|
|
65
|
-
/** The band past a loop box's content that its return to the next pass runs in, and the return's corner radius. */
|
|
66
|
-
export declare const RETURN_BAND = 24;
|
|
67
|
-
export declare const RETURN_R = 6;
|
|
68
|
-
export declare const SPACE: Record<'across' | 'down', LayoutSpace>;
|
|
69
|
-
/**
|
|
70
|
-
* Where everything of a layer's graph is drawn, from the sizes of its nodes, its stubs
|
|
71
|
-
* and its loop boxes' labels (`lbl:<box id>`): left to right, or top to bottom when
|
|
72
|
-
* `down`. Each container is laid out inside out, a box being one item of its parent:
|
|
73
|
-
* its layers side by side, an item at the start of its layer; across the flow, each
|
|
74
|
-
* item as near as its order allows to the items it is joined to (sweeps of weighted
|
|
75
|
-
* isotonic regression), so chains run straight. An edge runs along its points and
|
|
76
|
-
* bends only in the gap between two layers; it enters and leaves a box where its
|
|
77
|
-
* point inside is, and never passes a node or a box's label.
|
|
78
|
-
*/
|
|
79
|
-
export declare function layoutGraph(g: LayerGraph, sizes: ReadonlyMap<string, Size>, down?: boolean): GraphLayout;
|
|
80
|
-
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/elements/overview/graph/layout.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,YAAY,CAAC;AAExD,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,kCAAkC;AAClC,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,gHAAgH;AAChH,MAAM,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACzB,kCAAkC;IAClC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,IAAI,EAAE,GAAG,EAAE,CAAA;KAAE,EAAE,CAAC;IAC9E,+CAA+C;IAC/C,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM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