@contraagent/elements 0.0.0-stage → 0.1.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 +72 -2
- package/custom-elements.json +4260 -0
- package/dist/charts/bar-chart.d.ts +32 -0
- package/dist/charts/bar-chart.d.ts.map +1 -0
- package/dist/charts/bar-chart.js +70 -0
- package/dist/charts/bar-chart.js.map +1 -0
- package/dist/charts/base.d.ts +48 -0
- package/dist/charts/base.d.ts.map +1 -0
- package/dist/charts/base.js +203 -0
- package/dist/charts/base.js.map +1 -0
- package/dist/charts/column-chart.d.ts +42 -0
- package/dist/charts/column-chart.d.ts.map +1 -0
- package/dist/charts/column-chart.js +146 -0
- package/dist/charts/column-chart.js.map +1 -0
- package/dist/charts/heatmap.d.ts +42 -0
- package/dist/charts/heatmap.d.ts.map +1 -0
- package/dist/charts/heatmap.js +124 -0
- package/dist/charts/heatmap.js.map +1 -0
- package/dist/charts/index.d.ts +9 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +11 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/line-chart.d.ts +36 -0
- package/dist/charts/line-chart.d.ts.map +1 -0
- package/dist/charts/line-chart.js +118 -0
- package/dist/charts/line-chart.js.map +1 -0
- package/dist/charts/scale.d.ts +32 -0
- package/dist/charts/scale.d.ts.map +1 -0
- package/dist/charts/scale.js +50 -0
- package/dist/charts/scale.js.map +1 -0
- package/dist/charts/state-grid.d.ts +64 -0
- package/dist/charts/state-grid.d.ts.map +1 -0
- package/dist/charts/state-grid.js +223 -0
- package/dist/charts/state-grid.js.map +1 -0
- package/dist/charts/types.d.ts +34 -0
- package/dist/charts/types.d.ts.map +1 -0
- package/dist/charts/types.js +11 -0
- package/dist/charts/types.js.map +1 -0
- package/dist/checks/check-table.d.ts +32 -0
- package/dist/checks/check-table.d.ts.map +1 -0
- package/dist/checks/check-table.js +94 -0
- package/dist/checks/check-table.js.map +1 -0
- package/dist/checks/index.d.ts +4 -0
- package/dist/checks/index.d.ts.map +1 -0
- package/dist/checks/index.js +6 -0
- package/dist/checks/index.js.map +1 -0
- package/dist/checks/styles.d.ts +5 -0
- package/dist/checks/styles.d.ts.map +1 -0
- package/dist/checks/styles.js +30 -0
- package/dist/checks/styles.js.map +1 -0
- package/dist/checks/types.d.ts +35 -0
- package/dist/checks/types.d.ts.map +1 -0
- package/dist/checks/types.js +12 -0
- package/dist/checks/types.js.map +1 -0
- package/dist/core/clock.d.ts +20 -0
- package/dist/core/clock.d.ts.map +1 -0
- package/dist/core/clock.js +45 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/define.d.ts +3 -0
- package/dist/core/define.d.ts.map +1 -0
- package/dist/core/define.js +8 -0
- package/dist/core/define.js.map +1 -0
- package/dist/core/events.d.ts +78 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +8 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/format.d.ts +8 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +28 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/frame.d.ts +4 -0
- package/dist/core/frame.d.ts.map +1 -0
- package/dist/core/frame.js +5 -0
- package/dist/core/frame.js.map +1 -0
- package/dist/core/strings.d.ts +3 -0
- package/dist/core/strings.d.ts.map +1 -0
- package/dist/core/strings.js +14 -0
- package/dist/core/strings.js.map +1 -0
- package/dist/core/tone.d.ts +8 -0
- package/dist/core/tone.d.ts.map +1 -0
- package/dist/core/tone.js +9 -0
- package/dist/core/tone.js.map +1 -0
- package/dist/count/count.d.ts +22 -0
- package/dist/count/count.d.ts.map +1 -0
- package/dist/count/count.js +60 -0
- package/dist/count/count.js.map +1 -0
- package/dist/count/elapsed.d.ts +18 -0
- package/dist/count/elapsed.d.ts.map +1 -0
- package/dist/count/elapsed.js +33 -0
- package/dist/count/elapsed.js.map +1 -0
- package/dist/count/index.d.ts +3 -0
- package/dist/count/index.d.ts.map +1 -0
- package/dist/count/index.js +5 -0
- package/dist/count/index.js.map +1 -0
- package/dist/define/all.d.ts +13 -0
- package/dist/define/all.d.ts.map +1 -0
- package/dist/define/all.js +14 -0
- package/dist/define/all.js.map +1 -0
- package/dist/define/charts.d.ts +8 -0
- package/dist/define/charts.d.ts.map +1 -0
- package/dist/define/charts.js +15 -0
- package/dist/define/charts.js.map +1 -0
- package/dist/define/check-table.d.ts +4 -0
- package/dist/define/check-table.d.ts.map +1 -0
- package/dist/define/check-table.js +7 -0
- package/dist/define/check-table.js.map +1 -0
- package/dist/define/count.d.ts +5 -0
- package/dist/define/count.d.ts.map +1 -0
- package/dist/define/count.js +9 -0
- package/dist/define/count.js.map +1 -0
- package/dist/define/data-table.d.ts +4 -0
- package/dist/define/data-table.d.ts.map +1 -0
- package/dist/define/data-table.js +7 -0
- package/dist/define/data-table.js.map +1 -0
- package/dist/define/graph.d.ts +6 -0
- package/dist/define/graph.d.ts.map +1 -0
- package/dist/define/graph.js +9 -0
- package/dist/define/graph.js.map +1 -0
- package/dist/define/json-tree.d.ts +4 -0
- package/dist/define/json-tree.d.ts.map +1 -0
- package/dist/define/json-tree.js +7 -0
- package/dist/define/json-tree.js.map +1 -0
- package/dist/define/lanes.d.ts +4 -0
- package/dist/define/lanes.d.ts.map +1 -0
- package/dist/define/lanes.js +7 -0
- package/dist/define/lanes.js.map +1 -0
- package/dist/define/markdown.d.ts +4 -0
- package/dist/define/markdown.d.ts.map +1 -0
- package/dist/define/markdown.js +7 -0
- package/dist/define/markdown.js.map +1 -0
- package/dist/define/matrix.d.ts +4 -0
- package/dist/define/matrix.d.ts.map +1 -0
- package/dist/define/matrix.js +7 -0
- package/dist/define/matrix.js.map +1 -0
- package/dist/define/segmented.d.ts +4 -0
- package/dist/define/segmented.d.ts.map +1 -0
- package/dist/define/segmented.js +7 -0
- package/dist/define/segmented.js.map +1 -0
- package/dist/define/tiles.d.ts +5 -0
- package/dist/define/tiles.d.ts.map +1 -0
- package/dist/define/tiles.js +9 -0
- package/dist/define/tiles.js.map +1 -0
- package/dist/define/transcript.d.ts +4 -0
- package/dist/define/transcript.d.ts.map +1 -0
- package/dist/define/transcript.js +7 -0
- package/dist/define/transcript.js.map +1 -0
- package/dist/graph/arrange.d.ts +43 -0
- package/dist/graph/arrange.d.ts.map +1 -0
- package/dist/graph/arrange.js +390 -0
- package/dist/graph/arrange.js.map +1 -0
- package/dist/graph/card.d.ts +71 -0
- package/dist/graph/card.d.ts.map +1 -0
- package/dist/graph/card.js +185 -0
- package/dist/graph/card.js.map +1 -0
- package/dist/graph/host.d.ts +82 -0
- package/dist/graph/host.d.ts.map +1 -0
- package/dist/graph/host.js +21 -0
- package/dist/graph/host.js.map +1 -0
- package/dist/graph/icons.d.ts +7 -0
- package/dist/graph/icons.d.ts.map +1 -0
- package/dist/graph/icons.js +18 -0
- package/dist/graph/icons.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +17 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/layered-graph.d.ts +226 -0
- package/dist/graph/layered-graph.d.ts.map +1 -0
- package/dist/graph/layered-graph.js +396 -0
- package/dist/graph/layered-graph.js.map +1 -0
- package/dist/graph/layout.d.ts +80 -0
- package/dist/graph/layout.d.ts.map +1 -0
- package/dist/graph/layout.js +264 -0
- package/dist/graph/layout.js.map +1 -0
- package/dist/graph/marks.d.ts +24 -0
- package/dist/graph/marks.d.ts.map +1 -0
- package/dist/graph/marks.js +38 -0
- package/dist/graph/marks.js.map +1 -0
- package/dist/graph/nav.d.ts +14 -0
- package/dist/graph/nav.d.ts.map +1 -0
- package/dist/graph/nav.js +14 -0
- package/dist/graph/nav.js.map +1 -0
- package/dist/graph/pan-zoom.d.ts +80 -0
- package/dist/graph/pan-zoom.d.ts.map +1 -0
- package/dist/graph/pan-zoom.js +191 -0
- package/dist/graph/pan-zoom.js.map +1 -0
- package/dist/graph/paths.d.ts +9 -0
- package/dist/graph/paths.d.ts.map +1 -0
- package/dist/graph/paths.js +44 -0
- package/dist/graph/paths.js.map +1 -0
- package/dist/graph/place-card.d.ts +36 -0
- package/dist/graph/place-card.d.ts.map +1 -0
- package/dist/graph/place-card.js +68 -0
- package/dist/graph/place-card.js.map +1 -0
- package/dist/graph/strings.d.ts +50 -0
- package/dist/graph/strings.d.ts.map +1 -0
- package/dist/graph/strings.js +37 -0
- package/dist/graph/strings.js.map +1 -0
- package/dist/graph/styles.d.ts +2 -0
- package/dist/graph/styles.d.ts.map +1 -0
- package/dist/graph/styles.js +203 -0
- package/dist/graph/styles.js.map +1 -0
- package/dist/graph/types.d.ts +184 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +2 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/graph/view.d.ts +17 -0
- package/dist/graph/view.d.ts.map +1 -0
- package/dist/graph/view.js +21 -0
- package/dist/graph/view.js.map +1 -0
- package/dist/graph/views/dag.d.ts +10 -0
- package/dist/graph/views/dag.d.ts.map +1 -0
- package/dist/graph/views/dag.js +292 -0
- package/dist/graph/views/dag.js.map +1 -0
- package/dist/graph/views/foot.d.ts +8 -0
- package/dist/graph/views/foot.d.ts.map +1 -0
- package/dist/graph/views/foot.js +103 -0
- package/dist/graph/views/foot.js.map +1 -0
- package/dist/graph/views/node-table.d.ts +17 -0
- package/dist/graph/views/node-table.d.ts.map +1 -0
- package/dist/graph/views/node-table.js +80 -0
- package/dist/graph/views/node-table.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/json/index.d.ts +2 -0
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +3 -0
- package/dist/json/index.js.map +1 -0
- package/dist/json/json-tree.d.ts +21 -0
- package/dist/json/json-tree.d.ts.map +1 -0
- package/dist/json/json-tree.js +51 -0
- package/dist/json/json-tree.js.map +1 -0
- package/dist/lanes/index.d.ts +5 -0
- package/dist/lanes/index.d.ts.map +1 -0
- package/dist/lanes/index.js +7 -0
- package/dist/lanes/index.js.map +1 -0
- package/dist/lanes/lanes.d.ts +56 -0
- package/dist/lanes/lanes.d.ts.map +1 -0
- package/dist/lanes/lanes.js +160 -0
- package/dist/lanes/lanes.js.map +1 -0
- package/dist/lanes/stack.d.ts +26 -0
- package/dist/lanes/stack.d.ts.map +1 -0
- package/dist/lanes/stack.js +43 -0
- package/dist/lanes/stack.js.map +1 -0
- package/dist/lanes/styles.d.ts +2 -0
- package/dist/lanes/styles.d.ts.map +1 -0
- package/dist/lanes/styles.js +30 -0
- package/dist/lanes/styles.js.map +1 -0
- package/dist/lanes/types.d.ts +41 -0
- package/dist/lanes/types.d.ts.map +1 -0
- package/dist/lanes/types.js +6 -0
- package/dist/lanes/types.js.map +1 -0
- package/dist/markdown/cae-markdown.d.ts +37 -0
- package/dist/markdown/cae-markdown.d.ts.map +1 -0
- package/dist/markdown/cae-markdown.js +68 -0
- package/dist/markdown/cae-markdown.js.map +1 -0
- package/dist/markdown/highlight.d.ts +5 -0
- package/dist/markdown/highlight.d.ts.map +1 -0
- package/dist/markdown/highlight.js +86 -0
- package/dist/markdown/highlight.js.map +1 -0
- package/dist/markdown/index.d.ts +4 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +6 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/markdown.d.ts +4 -0
- package/dist/markdown/markdown.d.ts.map +1 -0
- package/dist/markdown/markdown.js +105 -0
- package/dist/markdown/markdown.js.map +1 -0
- package/dist/matrix/grid-step.d.ts +8 -0
- package/dist/matrix/grid-step.d.ts.map +1 -0
- package/dist/matrix/grid-step.js +69 -0
- package/dist/matrix/grid-step.js.map +1 -0
- package/dist/matrix/index.d.ts +5 -0
- package/dist/matrix/index.d.ts.map +1 -0
- package/dist/matrix/index.js +7 -0
- package/dist/matrix/index.js.map +1 -0
- package/dist/matrix/mark-matrix.d.ts +97 -0
- package/dist/matrix/mark-matrix.d.ts.map +1 -0
- package/dist/matrix/mark-matrix.js +272 -0
- package/dist/matrix/mark-matrix.js.map +1 -0
- package/dist/matrix/styles.d.ts +4 -0
- package/dist/matrix/styles.d.ts.map +1 -0
- package/dist/matrix/styles.js +47 -0
- package/dist/matrix/styles.js.map +1 -0
- package/dist/matrix/types.d.ts +79 -0
- package/dist/matrix/types.d.ts.map +1 -0
- package/dist/matrix/types.js +5 -0
- package/dist/matrix/types.js.map +1 -0
- package/dist/primitives/fact-line.d.ts +14 -0
- package/dist/primitives/fact-line.d.ts.map +1 -0
- package/dist/primitives/fact-line.js +18 -0
- package/dist/primitives/fact-line.js.map +1 -0
- package/dist/primitives/icon.d.ts +14 -0
- package/dist/primitives/icon.d.ts.map +1 -0
- package/dist/primitives/icon.js +19 -0
- package/dist/primitives/icon.js.map +1 -0
- package/dist/primitives/index.d.ts +10 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +13 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/legend.d.ts +28 -0
- package/dist/primitives/legend.d.ts.map +1 -0
- package/dist/primitives/legend.js +28 -0
- package/dist/primitives/legend.js.map +1 -0
- package/dist/primitives/pill.d.ts +23 -0
- package/dist/primitives/pill.d.ts.map +1 -0
- package/dist/primitives/pill.js +40 -0
- package/dist/primitives/pill.js.map +1 -0
- package/dist/primitives/roving-focus.d.ts +47 -0
- package/dist/primitives/roving-focus.d.ts.map +1 -0
- package/dist/primitives/roving-focus.js +111 -0
- package/dist/primitives/roving-focus.js.map +1 -0
- package/dist/primitives/segmented.d.ts +41 -0
- package/dist/primitives/segmented.d.ts.map +1 -0
- package/dist/primitives/segmented.js +88 -0
- package/dist/primitives/segmented.js.map +1 -0
- package/dist/primitives/share-bar.d.ts +37 -0
- package/dist/primitives/share-bar.d.ts.map +1 -0
- package/dist/primitives/share-bar.js +69 -0
- package/dist/primitives/share-bar.js.map +1 -0
- package/dist/primitives/states.d.ts +19 -0
- package/dist/primitives/states.d.ts.map +1 -0
- package/dist/primitives/states.js +11 -0
- package/dist/primitives/states.js.map +1 -0
- package/dist/primitives/window.d.ts +24 -0
- package/dist/primitives/window.d.ts.map +1 -0
- package/dist/primitives/window.js +56 -0
- package/dist/primitives/window.js.map +1 -0
- package/dist/styles/chips.d.ts +2 -0
- package/dist/styles/chips.d.ts.map +1 -0
- package/dist/styles/chips.js +18 -0
- package/dist/styles/chips.js.map +1 -0
- package/dist/styles/facts.d.ts +2 -0
- package/dist/styles/facts.d.ts.map +1 -0
- package/dist/styles/facts.js +7 -0
- package/dist/styles/facts.js.map +1 -0
- package/dist/styles/index.d.ts +16 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +15 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/layout.d.ts +2 -0
- package/dist/styles/layout.d.ts.map +1 -0
- package/dist/styles/layout.js +33 -0
- package/dist/styles/layout.js.map +1 -0
- package/dist/styles/marks.d.ts +2 -0
- package/dist/styles/marks.d.ts.map +1 -0
- package/dist/styles/marks.js +30 -0
- package/dist/styles/marks.js.map +1 -0
- package/dist/styles/meter.d.ts +3 -0
- package/dist/styles/meter.d.ts.map +1 -0
- package/dist/styles/meter.js +9 -0
- package/dist/styles/meter.js.map +1 -0
- package/dist/styles/motion.d.ts +2 -0
- package/dist/styles/motion.d.ts.map +1 -0
- package/dist/styles/motion.js +27 -0
- package/dist/styles/motion.js.map +1 -0
- package/dist/styles/prose.d.ts +3 -0
- package/dist/styles/prose.d.ts.map +1 -0
- package/dist/styles/prose.js +59 -0
- package/dist/styles/prose.js.map +1 -0
- package/dist/styles/reset.d.ts +2 -0
- package/dist/styles/reset.d.ts.map +1 -0
- package/dist/styles/reset.js +13 -0
- package/dist/styles/reset.js.map +1 -0
- package/dist/styles/status.d.ts +2 -0
- package/dist/styles/status.d.ts.map +1 -0
- package/dist/styles/status.js +52 -0
- package/dist/styles/status.js.map +1 -0
- package/dist/styles/text.d.ts +2 -0
- package/dist/styles/text.d.ts.map +1 -0
- package/dist/styles/text.js +21 -0
- package/dist/styles/text.js.map +1 -0
- package/dist/styles/tokens.d.ts +8 -0
- package/dist/styles/tokens.d.ts.map +1 -0
- package/dist/styles/tokens.js +32 -0
- package/dist/styles/tokens.js.map +1 -0
- package/dist/table/data-table.d.ts +106 -0
- package/dist/table/data-table.d.ts.map +1 -0
- package/dist/table/data-table.js +408 -0
- package/dist/table/data-table.js.map +1 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/index.js +6 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/styles.d.ts +2 -0
- package/dist/table/styles.d.ts.map +1 -0
- package/dist/table/styles.js +32 -0
- package/dist/table/styles.js.map +1 -0
- package/dist/table/types.d.ts +48 -0
- package/dist/table/types.d.ts.map +1 -0
- package/dist/table/types.js +30 -0
- package/dist/table/types.js.map +1 -0
- package/dist/themes/boot.d.ts +7 -0
- package/dist/themes/boot.d.ts.map +1 -0
- package/dist/themes/boot.js +14 -0
- package/dist/themes/boot.js.map +1 -0
- package/dist/themes/choice.d.ts +16 -0
- package/dist/themes/choice.d.ts.map +1 -0
- package/dist/themes/choice.js +45 -0
- package/dist/themes/choice.js.map +1 -0
- package/dist/themes/data.d.ts +43 -0
- package/dist/themes/data.d.ts.map +1 -0
- package/dist/themes/data.js +408 -0
- package/dist/themes/data.js.map +1 -0
- package/dist/themes/index.d.ts +7 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +11 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/sheet.d.ts +16 -0
- package/dist/themes/sheet.d.ts.map +1 -0
- package/dist/themes/sheet.js +28 -0
- package/dist/themes/sheet.js.map +1 -0
- package/dist/themes/token-meanings.d.ts +3 -0
- package/dist/themes/token-meanings.d.ts.map +1 -0
- package/dist/themes/token-meanings.js +67 -0
- package/dist/themes/token-meanings.js.map +1 -0
- package/dist/themes/tokens-list.d.ts +14 -0
- package/dist/themes/tokens-list.d.ts.map +1 -0
- package/dist/themes/tokens-list.js +69 -0
- package/dist/themes/tokens-list.js.map +1 -0
- package/dist/tiles/index.d.ts +4 -0
- package/dist/tiles/index.d.ts.map +1 -0
- package/dist/tiles/index.js +6 -0
- package/dist/tiles/index.js.map +1 -0
- package/dist/tiles/stat-tiles.d.ts +40 -0
- package/dist/tiles/stat-tiles.d.ts.map +1 -0
- package/dist/tiles/stat-tiles.js +99 -0
- package/dist/tiles/stat-tiles.js.map +1 -0
- package/dist/tiles/styles.d.ts +2 -0
- package/dist/tiles/styles.d.ts.map +1 -0
- package/dist/tiles/styles.js +23 -0
- package/dist/tiles/styles.js.map +1 -0
- package/dist/tiles/types.d.ts +22 -0
- package/dist/tiles/types.d.ts.map +1 -0
- package/dist/tiles/types.js +2 -0
- package/dist/tiles/types.js.map +1 -0
- package/dist/transcript/follow-scroll.d.ts +21 -0
- package/dist/transcript/follow-scroll.d.ts.map +1 -0
- package/dist/transcript/follow-scroll.js +76 -0
- package/dist/transcript/follow-scroll.js.map +1 -0
- package/dist/transcript/index.d.ts +5 -0
- package/dist/transcript/index.d.ts.map +1 -0
- package/dist/transcript/index.js +7 -0
- package/dist/transcript/index.js.map +1 -0
- package/dist/transcript/styles.d.ts +2 -0
- package/dist/transcript/styles.d.ts.map +1 -0
- package/dist/transcript/styles.js +114 -0
- package/dist/transcript/styles.js.map +1 -0
- package/dist/transcript/tags.d.ts +6 -0
- package/dist/transcript/tags.d.ts.map +1 -0
- package/dist/transcript/tags.js +13 -0
- package/dist/transcript/tags.js.map +1 -0
- package/dist/transcript/tool-card.d.ts +16 -0
- package/dist/transcript/tool-card.d.ts.map +1 -0
- package/dist/transcript/tool-card.js +87 -0
- package/dist/transcript/tool-card.js.map +1 -0
- package/dist/transcript/transcript.d.ts +103 -0
- package/dist/transcript/transcript.d.ts.map +1 -0
- package/dist/transcript/transcript.js +397 -0
- package/dist/transcript/transcript.js.map +1 -0
- package/dist/transcript/types.d.ts +161 -0
- package/dist/transcript/types.d.ts.map +1 -0
- package/dist/transcript/types.js +25 -0
- package/dist/transcript/types.js.map +1 -0
- package/docs/charts.md +58 -0
- package/docs/check-table.md +40 -0
- package/docs/data-table.md +57 -0
- package/docs/examples/charts.ts +61 -0
- package/docs/examples/check-table.ts +19 -0
- package/docs/examples/ci-pipeline.ts +271 -0
- package/docs/examples/data-table.ts +39 -0
- package/docs/examples/graph.ts +57 -0
- package/docs/examples/lanes.ts +40 -0
- package/docs/examples/matrix.ts +56 -0
- package/docs/examples/page.css +34 -0
- package/docs/examples/segmented.ts +18 -0
- package/docs/examples/status.ts +30 -0
- package/docs/examples/theme.css +54 -0
- package/docs/examples/tiles.ts +27 -0
- package/docs/examples/transcript.ts +59 -0
- package/docs/graph.md +112 -0
- package/docs/lanes.md +48 -0
- package/docs/matrix.md +34 -0
- package/docs/page.md +87 -0
- package/docs/primitives.md +57 -0
- package/docs/strings.md +16 -0
- package/docs/theming.md +147 -0
- package/docs/tiles.md +40 -0
- package/docs/transcript.md +73 -0
- package/docs/tsconfig.json +20 -0
- package/package.json +161 -4
- package/src/charts/bar-chart.ts +74 -0
- package/src/charts/base.ts +188 -0
- package/src/charts/column-chart.ts +153 -0
- package/src/charts/heatmap.ts +129 -0
- package/src/charts/index.ts +10 -0
- package/src/charts/line-chart.ts +128 -0
- package/src/charts/scale.ts +61 -0
- package/src/charts/state-grid.ts +245 -0
- package/src/charts/types.ts +48 -0
- package/src/checks/check-table.ts +85 -0
- package/src/checks/index.ts +5 -0
- package/src/checks/styles.ts +31 -0
- package/src/checks/types.ts +48 -0
- package/src/core/clock.ts +46 -0
- package/src/core/define.ts +7 -0
- package/src/core/events.ts +89 -0
- package/src/core/format.ts +25 -0
- package/src/core/frame.ts +5 -0
- package/src/core/strings.ts +11 -0
- package/src/core/tone.ts +14 -0
- package/src/count/count.ts +54 -0
- package/src/count/elapsed.ts +33 -0
- package/src/count/index.ts +4 -0
- package/src/define/all.ts +13 -0
- package/src/define/charts.ts +17 -0
- package/src/define/check-table.ts +9 -0
- package/src/define/count.ts +11 -0
- package/src/define/data-table.ts +9 -0
- package/src/define/graph.ts +11 -0
- package/src/define/json-tree.ts +9 -0
- package/src/define/lanes.ts +9 -0
- package/src/define/markdown.ts +9 -0
- package/src/define/matrix.ts +9 -0
- package/src/define/segmented.ts +9 -0
- package/src/define/tiles.ts +11 -0
- package/src/define/transcript.ts +9 -0
- package/src/graph/arrange.ts +399 -0
- package/src/graph/card.ts +209 -0
- package/src/graph/host.ts +100 -0
- package/src/graph/icons.ts +23 -0
- package/src/graph/index.ts +16 -0
- package/src/graph/layered-graph.ts +417 -0
- package/src/graph/layout.ts +331 -0
- package/src/graph/marks.ts +42 -0
- package/src/graph/nav.ts +19 -0
- package/src/graph/pan-zoom.ts +219 -0
- package/src/graph/paths.ts +41 -0
- package/src/graph/place-card.ts +93 -0
- package/src/graph/strings.ts +86 -0
- package/src/graph/styles.ts +204 -0
- package/src/graph/types.ts +202 -0
- package/src/graph/view.ts +28 -0
- package/src/graph/views/dag.ts +294 -0
- package/src/graph/views/foot.ts +109 -0
- package/src/graph/views/node-table.ts +90 -0
- package/src/index.ts +25 -0
- package/src/json/index.ts +2 -0
- package/src/json/json-tree.ts +49 -0
- package/src/lanes/index.ts +6 -0
- package/src/lanes/lanes.ts +143 -0
- package/src/lanes/stack.ts +51 -0
- package/src/lanes/styles.ts +30 -0
- package/src/lanes/types.ts +51 -0
- package/src/markdown/cae-markdown.ts +64 -0
- package/src/markdown/highlight.ts +94 -0
- package/src/markdown/index.ts +5 -0
- package/src/markdown/markdown.ts +110 -0
- package/src/matrix/grid-step.ts +58 -0
- package/src/matrix/index.ts +6 -0
- package/src/matrix/mark-matrix.ts +285 -0
- package/src/matrix/styles.ts +48 -0
- package/src/matrix/types.ts +83 -0
- package/src/primitives/fact-line.ts +26 -0
- package/src/primitives/icon.ts +26 -0
- package/src/primitives/index.ts +12 -0
- package/src/primitives/legend.ts +56 -0
- package/src/primitives/pill.ts +58 -0
- package/src/primitives/roving-focus.ts +138 -0
- package/src/primitives/segmented.ts +92 -0
- package/src/primitives/share-bar.ts +94 -0
- package/src/primitives/states.ts +28 -0
- package/src/primitives/window.ts +65 -0
- package/src/styles/chips.ts +18 -0
- package/src/styles/facts.ts +7 -0
- package/src/styles/index.ts +19 -0
- package/src/styles/layout.ts +33 -0
- package/src/styles/marks.ts +30 -0
- package/src/styles/meter.ts +9 -0
- package/src/styles/motion.ts +27 -0
- package/src/styles/prose.ts +59 -0
- package/src/styles/reset.ts +13 -0
- package/src/styles/status.ts +52 -0
- package/src/styles/text.ts +21 -0
- package/src/styles/tokens.ts +35 -0
- package/src/table/data-table.ts +367 -0
- package/src/table/index.ts +5 -0
- package/src/table/styles.ts +32 -0
- package/src/table/types.ts +73 -0
- package/src/themes/boot.ts +14 -0
- package/src/themes/choice.ts +47 -0
- package/src/themes/data.ts +433 -0
- package/src/themes/index.ts +10 -0
- package/src/themes/sheet.ts +29 -0
- package/src/themes/token-meanings.ts +67 -0
- package/src/themes/tokens-list.ts +82 -0
- package/src/tiles/index.ts +5 -0
- package/src/tiles/stat-tiles.ts +92 -0
- package/src/tiles/styles.ts +23 -0
- package/src/tiles/types.ts +20 -0
- package/src/transcript/follow-scroll.ts +72 -0
- package/src/transcript/index.ts +6 -0
- package/src/transcript/styles.ts +114 -0
- package/src/transcript/tags.ts +18 -0
- package/src/transcript/tool-card.ts +103 -0
- package/src/transcript/transcript.ts +358 -0
- package/src/transcript/types.ts +167 -0
package/docs/charts.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Charts
|
|
2
|
+
|
|
3
|
+
Five charts of plain series: `<cae-column-chart>` (vertical bars, stacked or
|
|
4
|
+
side by side), `<cae-line-chart>`, `<cae-heatmap>`, `<cae-state-grid>` (a state
|
|
5
|
+
per row and column) and `<cae-bar-chart>` (horizontal bars). Register them with
|
|
6
|
+
`@contraagent/elements/charts/define`; the types and the arithmetic they share
|
|
7
|
+
are in `@contraagent/elements/charts`.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
::code{file="examples/charts.ts"}
|
|
12
|
+
|
|
13
|
+
## Series and values
|
|
14
|
+
|
|
15
|
+
A chart takes labels (`x`) and series, each a name and a value per label; a
|
|
16
|
+
null value is a value the series has not: no bar, a break in a line, an empty
|
|
17
|
+
cell. A heatmap takes its rows (`y`), its columns (`x`) and `values[row][column]`;
|
|
18
|
+
a state grid the same rows and columns and `cells[row][column]`, each a state's
|
|
19
|
+
`label`, its `tone` and an optional `tip` (null: no cell); a bar chart takes
|
|
20
|
+
`bars`, each a label, a value and an optional `tone`.
|
|
21
|
+
|
|
22
|
+
::code{file="../src/charts/types.ts" from="/** One series" to="/** The words of a chart"}
|
|
23
|
+
|
|
24
|
+
`format` writes a value in words (`$1.20`, `42%`, `2m 05s`): on the axis, in the
|
|
25
|
+
tooltip and in the table. It is the host's, since the chart does not know the
|
|
26
|
+
unit.
|
|
27
|
+
|
|
28
|
+
## Colour
|
|
29
|
+
|
|
30
|
+
The series take the series colours (`--ca-series-1` to `--ca-series-6`) in
|
|
31
|
+
their order, so a series keeps its colour whatever its values and its rank. A
|
|
32
|
+
chart never makes up a seventh colour: past six series, a column chart sums the
|
|
33
|
+
sixth and later into one series, `strings.other`, in the neutral `--ca-meter`;
|
|
34
|
+
a line chart draws them in that colour and names each in the legend and the
|
|
35
|
+
tooltip. A heatmap uses one hue, light to dark in five steps between its lowest
|
|
36
|
+
and highest value. A state grid colours a cell by its tone, so a failure and
|
|
37
|
+
what needs attention stand out and a cell that ended well stays quiet; the
|
|
38
|
+
colour is never alone: a cell wide enough holds its tone's mark (✓ done,
|
|
39
|
+
✕ failed, ◌ attention; a done cell's mark is quieter), the legend names each
|
|
40
|
+
state once, failures and what needs attention first, and the tooltip and the
|
|
41
|
+
table say the state in words. A bar
|
|
42
|
+
with a `tone` takes that status colour; a status colour is never a series.
|
|
43
|
+
|
|
44
|
+
## Reading it
|
|
45
|
+
|
|
46
|
+
Two or more series have a legend; one series has none, since the chart's title
|
|
47
|
+
names it. Pointing at a label, or moving to it with the arrow keys once the
|
|
48
|
+
chart has the focus (up and down by a row in a heatmap and a state grid, Home and End to the
|
|
49
|
+
ends, Escape to close), shows its values in a tooltip. Every chart has a switch
|
|
50
|
+
to a table of the same values (`strings.showTable`, `strings.showChart`), which
|
|
51
|
+
is also how a screen reader reads it. A bar chart writes each value beside its
|
|
52
|
+
bar.
|
|
53
|
+
|
|
54
|
+
## Look
|
|
55
|
+
|
|
56
|
+
`height` sets a column or line chart's height in px (200 by default; the rows of
|
|
57
|
+
a heatmap and of a state grid are 22px each). The parts are `plot`, `table`, `switch`, `legend` and
|
|
58
|
+
`empty`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Check table
|
|
2
|
+
|
|
3
|
+
`<cae-check-table>` shows named values checked one by one: a row per name,
|
|
4
|
+
with what it must be, what it is and the verdict. Register it with
|
|
5
|
+
`@contraagent/elements/check-table/define`; the types, `verdict` and
|
|
6
|
+
`verdictStyles` are in `@contraagent/elements/check-table`.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
<!-- not on the site -->
|
|
11
|
+
Live on this topic's page of the documentation site (`pnpm run docs` in `web/`).
|
|
12
|
+
|
|
13
|
+
::code{file="examples/check-table.ts"}
|
|
14
|
+
|
|
15
|
+
## Rows
|
|
16
|
+
|
|
17
|
+
A row is a `CheckRow`. The host judges each value; the table shows the
|
|
18
|
+
verdict: `pass` (✓ and its word), `fail` (✕ and its word, in the failed
|
|
19
|
+
tone), `warn` (its word, in the attention tone) or `none` (its word, muted, or
|
|
20
|
+
an empty cell without one). The marks are hidden from screen readers, which
|
|
21
|
+
read the word.
|
|
22
|
+
|
|
23
|
+
::code{file="../src/checks/types.ts" from="export interface CheckRow" to="export interface CheckTableStrings"}
|
|
24
|
+
|
|
25
|
+
A value is shown in one line: a string quoted and cut, a list's length and its
|
|
26
|
+
first items, an object's first keys. A row with `extra` names a value that is
|
|
27
|
+
not expected: its `expected` is a phrase, not code. Without `showValues`, the
|
|
28
|
+
table shows only the names and what each must be.
|
|
29
|
+
|
|
30
|
+
## Verdicts elsewhere
|
|
31
|
+
|
|
32
|
+
`verdict(v, label, tip)` draws a verdict as the table does, for a host that
|
|
33
|
+
shows one outside a table; add `verdictStyles` to the host's styles.
|
|
34
|
+
|
|
35
|
+
## Look
|
|
36
|
+
|
|
37
|
+
The table is as wide as its content, so each verdict sits next to the value it
|
|
38
|
+
judges; a long value wraps. The parts are `table`, `row` and `verdict`. The
|
|
39
|
+
words are `strings` ([Strings](strings.md)): the headers, `optional`, and the
|
|
40
|
+
summaries of a list (`items`) and an object.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Data table
|
|
2
|
+
|
|
3
|
+
`<cae-data-table>` shows rows of data in a real `<table>`: a header cell per
|
|
4
|
+
column, and the first `rowHeader` column as the header of its row, so a screen
|
|
5
|
+
reader names each cell by its column and its row. Register it with
|
|
6
|
+
`@contraagent/elements/data-table/define`; the types and `sortRows` are in
|
|
7
|
+
`@contraagent/elements/data-table`.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
<!-- not on the site -->
|
|
12
|
+
Live on this topic's page of the documentation site (`pnpm run docs` in `web/`).
|
|
13
|
+
|
|
14
|
+
::code{file="examples/data-table.ts"}
|
|
15
|
+
|
|
16
|
+
## Columns
|
|
17
|
+
|
|
18
|
+
A column is a `DataColumn`: its header, a CSS grid track as its width, and a
|
|
19
|
+
function that draws its cell for a row (a template, a string or a number).
|
|
20
|
+
Every row is a grid of the columns' tracks, so the rows line up with the header.
|
|
21
|
+
|
|
22
|
+
::code{file="../src/table/types.ts" from="/** A column:" to="/** The column the rows are ordered by. */"}
|
|
23
|
+
|
|
24
|
+
## Keyboard and events
|
|
25
|
+
|
|
26
|
+
The rows are one tab stop. The arrow keys move between rows, and Home and End
|
|
27
|
+
move to the first and the last row. Enter or a click on a row sends
|
|
28
|
+
`cae-activate` with the row's id (`rowKey`). With `activatable` off, they choose
|
|
29
|
+
the row as the selection and send `cae-select`; the selected row has the part
|
|
30
|
+
`row-selected`. A click on a button or a link inside a cell is that control's.
|
|
31
|
+
|
|
32
|
+
A column with `compare` (or `sortable`) has a header button that sends
|
|
33
|
+
`cae-sort` with the column and the direction. The table does not reorder the
|
|
34
|
+
rows: the host sets `sort` and the rows, ordered by `sortRows` or its own way.
|
|
35
|
+
`sortRows` orders by the column's `compare`, else its `text`, else its cell when
|
|
36
|
+
the cell is a string or a number: a column of plain values needs only `sortable`.
|
|
37
|
+
|
|
38
|
+
## Long lists
|
|
39
|
+
|
|
40
|
+
Above `windowAt` rows (200), the table draws only the rows on screen and a
|
|
41
|
+
spacer for the rows above and below them, so the scroll height stays that of
|
|
42
|
+
the whole list. The rows' height is measured; `rowHeight` is the first
|
|
43
|
+
estimate. The table finds the element that scrolls it, across shadow roots, or
|
|
44
|
+
the window.
|
|
45
|
+
|
|
46
|
+
## Look
|
|
47
|
+
|
|
48
|
+
`--cae-data-table-gap` sets the space between the columns and
|
|
49
|
+
`--cae-data-table-row-padding` a row's padding. The parts are `table`,
|
|
50
|
+
`caption`, `head`, `header-cell`, `row`, `row-selected`, `cell` and `empty`;
|
|
51
|
+
`rowTone` gives a row a tone (`data-tone`) and `rowAttrs` more attributes. What
|
|
52
|
+
the cells draw lives in the table's shadow root: `cellStyles` adds styles there,
|
|
53
|
+
after the table's own (the rows are `tr`, the cells `th` and `td`, each with
|
|
54
|
+
`data-col` set to its column's id).
|
|
55
|
+
|
|
56
|
+
The words are `strings` ([Strings](strings.md)): `empty` with no rows (or the
|
|
57
|
+
`empty` slot), and the sort buttons' tooltips.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Charts: a CI pipeline's minutes by day and stage (stacked columns), its queue
|
|
2
|
+
// time (lines), its builds by weekday and hour (a heatmap), how its nightly builds
|
|
3
|
+
// ended (a state grid) and its test funnel (horizontal bars). The host gives each
|
|
4
|
+
// chart its unit's format.
|
|
5
|
+
import '@contraagent/elements/charts/define';
|
|
6
|
+
import type { ChartSeries } from '@contraagent/elements/charts';
|
|
7
|
+
|
|
8
|
+
const days = ['10-08', '10-09', '10-10', '10-11', '10-12', '10-13', '10-14'];
|
|
9
|
+
const minutes: ChartSeries[] = [
|
|
10
|
+
{ name: 'build', values: [42, 38, 51, 12, 9, 47, 44] },
|
|
11
|
+
{ name: 'test', values: [65, 70, 58, 20, null, 61, 66] },
|
|
12
|
+
{ name: 'deploy', values: [8, 8, 9, 2, 2, 10, 8] },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export function mount(host: HTMLElement): void {
|
|
16
|
+
const columns = document.createElement('cae-column-chart');
|
|
17
|
+
columns.label = 'Minutes by day';
|
|
18
|
+
columns.x = days;
|
|
19
|
+
columns.series = minutes;
|
|
20
|
+
columns.stacked = true;
|
|
21
|
+
columns.format = (v) => `${v} min`;
|
|
22
|
+
|
|
23
|
+
const lines = document.createElement('cae-line-chart');
|
|
24
|
+
lines.label = 'Queue time';
|
|
25
|
+
lines.x = days;
|
|
26
|
+
lines.series = [
|
|
27
|
+
{ name: 'median', values: [1.2, 1.4, 0.9, 0.3, 0.2, 1.8, 1.1] },
|
|
28
|
+
{ name: 'slowest', values: [6, 9, 4, 1, 1, 12, 7] },
|
|
29
|
+
];
|
|
30
|
+
lines.format = (v) => `${v} min`;
|
|
31
|
+
|
|
32
|
+
const heat = document.createElement('cae-heatmap');
|
|
33
|
+
heat.label = 'Builds by weekday and hour';
|
|
34
|
+
heat.x = ['9', '10', '11', '12', '13', '14', '15', '16', '17'];
|
|
35
|
+
heat.y = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'];
|
|
36
|
+
// A count per weekday and hour; Wednesday at 13 has no record (null: an empty cell).
|
|
37
|
+
heat.values = heat.y.map((_, r) => heat.x.map((_, c) => (r === 2 && c === 4 ? null : (r * 7 + c * 3) % 9)));
|
|
38
|
+
heat.strings = { scale: (low, high) => `${low} to ${high} builds` };
|
|
39
|
+
|
|
40
|
+
const bars = document.createElement('cae-bar-chart');
|
|
41
|
+
bars.label = 'Tests this week';
|
|
42
|
+
bars.bars = [
|
|
43
|
+
{ label: 'written', value: 1240 },
|
|
44
|
+
{ label: 'run', value: 1180 },
|
|
45
|
+
{ label: 'passed', value: 1162 },
|
|
46
|
+
{ label: 'flaky', value: 18, tone: 'attention' },
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const nightly = document.createElement('cae-state-grid');
|
|
50
|
+
nightly.label = 'Nightly builds by weekday and hour';
|
|
51
|
+
nightly.x = ['0', '1', '2', '3'];
|
|
52
|
+
nightly.y = ['Mon', 'Tue'];
|
|
53
|
+
const passed = { label: 'passed', tone: 'done' as const };
|
|
54
|
+
// A state per weekday and hour: its word, its tone, and a fact for the tooltip; null: no build.
|
|
55
|
+
nightly.cells = [
|
|
56
|
+
[passed, { label: 'failed', tone: 'failed', tip: 'build 4127' }, passed, null],
|
|
57
|
+
[passed, passed, { label: 'skipped', tone: 'muted' }, passed],
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
host.replaceChildren(columns, lines, heat, nightly, bars);
|
|
61
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// A check table: hand-written fields of a settings file, each checked against
|
|
2
|
+
// what it must be. The host judges the values; the table shows the verdicts.
|
|
3
|
+
import '@contraagent/elements/check-table/define';
|
|
4
|
+
import type { CheckRow } from '@contraagent/elements/check-table';
|
|
5
|
+
|
|
6
|
+
const rows: CheckRow[] = [
|
|
7
|
+
{ name: 'name', expected: 'string', hasValue: true, value: 'release-build', verdict: 'pass', verdictLabel: 'passed' },
|
|
8
|
+
{ name: 'retries', expected: 'integer', hasValue: true, value: '3', verdict: 'fail', verdictLabel: 'wrong type', tip: 'Expected integer' },
|
|
9
|
+
{ name: 'targets', expected: 'list[str]', hasValue: true, value: ['linux', 'macos', 'windows', 'wasm'], verdict: 'pass', verdictLabel: 'passed' },
|
|
10
|
+
{ name: 'cache', expected: 'object', optional: true, hasValue: false, verdict: 'none', verdictLabel: 'absent (optional)' },
|
|
11
|
+
{ name: 'colour', expected: 'not in the schema', extra: true, hasValue: true, value: 'blue', verdict: 'warn', verdictLabel: 'extra field' },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export function mount(host: HTMLElement): void {
|
|
15
|
+
const table = document.createElement('cae-check-table');
|
|
16
|
+
table.rows = rows;
|
|
17
|
+
table.strings = { name: 'Field', actual: 'In the file' };
|
|
18
|
+
host.replaceChildren(table);
|
|
19
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// A whole page from the generic elements: one run of a made-up CI pipeline.
|
|
2
|
+
// A theme switch, stat tiles, a sortable table of jobs, and a layered graph of
|
|
3
|
+
// the steps (a shard is a series; the end-to-end tests repeat in a retry loop),
|
|
4
|
+
// with a detail panel of the page's own beside them. The page holds the data
|
|
5
|
+
// and the state (the theme, the selection, the order), and answers the events.
|
|
6
|
+
import '@contraagent/elements/segmented/define'; // <cae-segmented>
|
|
7
|
+
import '@contraagent/elements/tiles/define'; // <cae-stat-tiles>
|
|
8
|
+
import '@contraagent/elements/data-table/define'; // <cae-data-table>
|
|
9
|
+
import '@contraagent/elements/graph/define'; // <cae-layered-graph>
|
|
10
|
+
import { adoptThemes } from '@contraagent/elements/themes';
|
|
11
|
+
import { fmtDur, pill, type StateStyles } from '@contraagent/elements';
|
|
12
|
+
import { sortRows, type CaeDataTable, type DataColumn } from '@contraagent/elements/data-table';
|
|
13
|
+
import type { GraphInput, GraphMark, GraphNodeInput } from '@contraagent/elements/graph';
|
|
14
|
+
import type { StatTile } from '@contraagent/elements/tiles';
|
|
15
|
+
|
|
16
|
+
// ---- The data: a step is a node, a job is one run of a step (or of one shard of it).
|
|
17
|
+
|
|
18
|
+
type State = 'done' | 'failed' | 'running' | 'queued';
|
|
19
|
+
|
|
20
|
+
interface Job {
|
|
21
|
+
id: string;
|
|
22
|
+
step: string;
|
|
23
|
+
/** The shard ('1' to '3'), or null for a step that runs once. */
|
|
24
|
+
shard: string | null;
|
|
25
|
+
/** The pass of the retry loop it ran in (1 outside the loop). */
|
|
26
|
+
pass: number;
|
|
27
|
+
state: State;
|
|
28
|
+
seconds: number;
|
|
29
|
+
runner: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const steps = [
|
|
33
|
+
{ id: 'lint', label: 'lint', loop: false },
|
|
34
|
+
{ id: 'unit', label: 'unit tests', loop: false },
|
|
35
|
+
{ id: 'build', label: 'build', loop: false },
|
|
36
|
+
{ id: 'e2e', label: 'e2e tests', loop: true },
|
|
37
|
+
{ id: 'triage', label: 'triage failures', loop: true },
|
|
38
|
+
{ id: 'deploy', label: 'deploy preview', loop: false },
|
|
39
|
+
];
|
|
40
|
+
const shards = ['1', '2', '3'];
|
|
41
|
+
|
|
42
|
+
const job = (step: string, shard: string | null, pass: number, state: State, seconds: number, runner: string): Job => ({
|
|
43
|
+
id: `${step}${shard ? `/${shard}` : ''}#${pass}`,
|
|
44
|
+
step,
|
|
45
|
+
shard,
|
|
46
|
+
pass,
|
|
47
|
+
state,
|
|
48
|
+
seconds,
|
|
49
|
+
runner,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const jobs: Job[] = [
|
|
53
|
+
job('lint', null, 1, 'done', 41, 'small-1'),
|
|
54
|
+
job('unit', '1', 1, 'done', 188, 'large-1'),
|
|
55
|
+
job('unit', '2', 1, 'done', 203, 'large-2'),
|
|
56
|
+
job('unit', '3', 1, 'done', 176, 'large-3'),
|
|
57
|
+
job('build', null, 1, 'done', 315, 'large-1'),
|
|
58
|
+
job('e2e', '1', 1, 'done', 402, 'large-2'),
|
|
59
|
+
job('e2e', '2', 1, 'failed', 377, 'large-3'),
|
|
60
|
+
job('e2e', '3', 1, 'done', 395, 'large-1'),
|
|
61
|
+
job('triage', null, 1, 'done', 12, 'small-1'),
|
|
62
|
+
job('e2e', '2', 2, 'done', 381, 'large-2'),
|
|
63
|
+
job('triage', null, 2, 'done', 9, 'small-1'),
|
|
64
|
+
job('deploy', null, 1, 'running', 74, 'deploy-1'),
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
// ---- What each state looks like: a word, a tone, a shape (the legend follows this order).
|
|
68
|
+
|
|
69
|
+
const states: StateStyles = {
|
|
70
|
+
done: { label: 'done', tone: 'done', shape: 'round', rank: 0 },
|
|
71
|
+
queued: { label: 'queued', tone: 'muted', shape: 'ring', rank: 1 },
|
|
72
|
+
running: { label: 'running', tone: 'running', shape: 'round', rank: 2 },
|
|
73
|
+
failed: { label: 'failed', tone: 'failed', shape: 'square', rank: 3 },
|
|
74
|
+
};
|
|
75
|
+
const toneOf = (s: State) => states[s]!.tone;
|
|
76
|
+
const jobName = (j: Job) => `${steps.find((s) => s.id === j.step)!.label}${j.shard ? ` shard ${j.shard}` : ''}`;
|
|
77
|
+
|
|
78
|
+
// ---- The graph: a mark per shard (or one loose mark), the last pass's state, the passes as a badge.
|
|
79
|
+
|
|
80
|
+
/** The id of a mark: a step's shard, or the step's single job. */
|
|
81
|
+
const markId = (j: Job) => `${j.step}/${j.shard ?? '-'}`;
|
|
82
|
+
|
|
83
|
+
function mark(runs: Job[]): GraphMark {
|
|
84
|
+
const last = runs[runs.length - 1]!;
|
|
85
|
+
const passes = runs.length > 1 ? `${runs.length} passes` : '1 pass';
|
|
86
|
+
return { id: markId(last), state: last.state, label: `${jobName(last)} | ${last.state} | ${passes}`, tip: jobName(last), badge: runs.length > 1 ? String(runs.length) : undefined };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function node(step: (typeof steps)[number]): GraphNodeInput {
|
|
90
|
+
const own = jobs.filter((j) => j.step === step.id);
|
|
91
|
+
const runsOf = (shard: string | null) => own.filter((j) => j.shard === shard);
|
|
92
|
+
const sharded = own.some((j) => j.shard);
|
|
93
|
+
const marks = sharded ? shards.map((s) => (runsOf(s).length ? mark(runsOf(s)) : null)) : [];
|
|
94
|
+
const loose = sharded ? [] : [mark(runsOf(null))];
|
|
95
|
+
// `counts` and `progress` ("2/3") default to what the marks say.
|
|
96
|
+
// A job that failed in an earlier pass is not in the marks: the line under them names it.
|
|
97
|
+
const failed = own.filter((j) => j.state === 'failed').length;
|
|
98
|
+
return {
|
|
99
|
+
id: step.id,
|
|
100
|
+
label: step.label,
|
|
101
|
+
cluster: step.loop ? 'retry' : null,
|
|
102
|
+
marks,
|
|
103
|
+
loose,
|
|
104
|
+
notes: failed ? [{ text: `${failed} failed ${failed === 1 ? 'job' : 'jobs'}`, tone: 'failed' }] : [],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const graph: GraphInput = {
|
|
109
|
+
series: shards,
|
|
110
|
+
nodes: steps.map(node),
|
|
111
|
+
clusters: [{ id: 'retry', parent: null, label: 'retry loop', note: 'up to 3 passes', cycle: true }],
|
|
112
|
+
edges: [
|
|
113
|
+
{ from: 'lint', to: 'build', style: 'solid', weight: 1, ranks: true },
|
|
114
|
+
{ from: 'unit', to: 'build', style: 'solid', weight: 3, ranks: true },
|
|
115
|
+
{ from: 'build', to: 'e2e', style: 'solid', weight: 3, ranks: true },
|
|
116
|
+
{ from: 'e2e', to: 'triage', style: 'solid', weight: 3, ranks: true },
|
|
117
|
+
// The next pass: from triage back to the tests. It does not set the layers.
|
|
118
|
+
{ from: 'triage', to: 'e2e', style: 'solid', weight: 1, ranks: false },
|
|
119
|
+
{ from: 'triage', to: 'deploy', style: 'solid', weight: 1, ranks: true },
|
|
120
|
+
],
|
|
121
|
+
stubs: [{ id: 'push', label: 'push to main', to: 'lint', style: 'solid', weight: 1 }],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// ---- The table: a row per job; every column sorts.
|
|
125
|
+
|
|
126
|
+
const columns: DataColumn<Job>[] = [
|
|
127
|
+
{ id: 'job', header: 'Job', rowHeader: true, cell: jobName, sortable: true },
|
|
128
|
+
{ id: 'pass', header: 'Pass', align: 'end', width: '72px', cell: (j) => j.pass, compare: (a, b) => a.pass - b.pass },
|
|
129
|
+
{ id: 'state', header: 'State', width: '120px', cell: (j) => pill({ text: j.state, tone: toneOf(j.state) }), compare: (a, b) => states[a.state]!.rank - states[b.state]!.rank },
|
|
130
|
+
{ id: 'time', header: 'Time', align: 'end', width: '96px', cell: (j) => fmtDur(j.seconds), compare: (a, b) => a.seconds - b.seconds },
|
|
131
|
+
{ id: 'runner', header: 'Runner', width: '120px', cell: (j) => j.runner, sortable: true },
|
|
132
|
+
];
|
|
133
|
+
|
|
134
|
+
// ---- The tiles.
|
|
135
|
+
|
|
136
|
+
const failed = jobs.filter((j) => j.state === 'failed');
|
|
137
|
+
const passes = Math.max(...jobs.map((j) => j.pass));
|
|
138
|
+
const count = (s: State) => jobs.filter((j) => j.state === s).length;
|
|
139
|
+
const tiles: StatTile[] = [
|
|
140
|
+
{ id: 'jobs', label: 'Jobs', value: jobs.length, sub: [[`${count('done')} done`, `${count('running')} running`]] },
|
|
141
|
+
{ id: 'failed', label: 'Failed jobs', value: failed.length, tone: failed.length ? 'failed' : undefined, sub: [failed.length ? failed.map((j) => `${jobName(j)}, pass ${j.pass}`) : ['All jobs passed']] },
|
|
142
|
+
{ id: 'passes', label: 'Passes of the retry loop', value: passes, sub: [['Up to 3']] },
|
|
143
|
+
{ id: 'time', label: 'Job time', value: fmtDur(jobs.reduce((t, j) => t + j.seconds, 0)), tip: 'Sum over all jobs' },
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
// ---- The page's own styles. Its colours are the theme's, so the page changes with the switch.
|
|
147
|
+
|
|
148
|
+
const css = `
|
|
149
|
+
.ci-page {
|
|
150
|
+
background: var(--ca-bg);
|
|
151
|
+
color: var(--ca-text);
|
|
152
|
+
font: 14px/1.45 system-ui, sans-serif;
|
|
153
|
+
padding: 16px;
|
|
154
|
+
display: grid;
|
|
155
|
+
gap: 16px;
|
|
156
|
+
container-type: inline-size;
|
|
157
|
+
}
|
|
158
|
+
.ci-page header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
|
|
159
|
+
.ci-page h2 { font-size: 18px; margin: 0; flex: 1; color: var(--ca-text); }
|
|
160
|
+
.ci-page h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--ca-text-secondary); }
|
|
161
|
+
.ci-page .body { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
|
|
162
|
+
.ci-page .main { display: grid; gap: 16px; min-width: 0; }
|
|
163
|
+
.ci-page aside { background: var(--ca-card); border: 1px solid var(--ca-line); border-radius: 8px; padding: 12px; position: sticky; top: 0; }
|
|
164
|
+
.ci-page dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
|
|
165
|
+
.ci-page dt { color: var(--ca-text-muted); }
|
|
166
|
+
.ci-page dd { margin: 0; }
|
|
167
|
+
@container (max-width: 760px) { .ci-page .body { grid-template-columns: minmax(0, 1fr); } }
|
|
168
|
+
`;
|
|
169
|
+
|
|
170
|
+
// ---- The page: build it, then answer the events.
|
|
171
|
+
|
|
172
|
+
export function mount(host: HTMLElement): void {
|
|
173
|
+
adoptThemes(document);
|
|
174
|
+
host.dataset['caTheme'] = 'contraagent-dark';
|
|
175
|
+
|
|
176
|
+
const page = document.createElement('div');
|
|
177
|
+
page.className = 'ci-page';
|
|
178
|
+
page.innerHTML = `<style>${css}</style>
|
|
179
|
+
<header><h2>web-app | pipeline 482 | main</h2></header>
|
|
180
|
+
<div class="body">
|
|
181
|
+
<div class="main">
|
|
182
|
+
<section><h3>Pipeline</h3></section>
|
|
183
|
+
<section></section>
|
|
184
|
+
</div>
|
|
185
|
+
<aside aria-live="polite"><h3>Selected</h3><div class="detail">No selection</div></aside>
|
|
186
|
+
</div>`;
|
|
187
|
+
const [graphBox, tableBox] = page.querySelectorAll('section');
|
|
188
|
+
const detail = page.querySelector<HTMLElement>('.detail')!;
|
|
189
|
+
|
|
190
|
+
// The theme: `data-ca-theme` on the box that holds the page.
|
|
191
|
+
const theme = document.createElement('cae-segmented');
|
|
192
|
+
theme.label = 'Theme';
|
|
193
|
+
theme.options = [
|
|
194
|
+
{ value: 'contraagent-dark', label: 'Dark' },
|
|
195
|
+
{ value: 'contraagent-light', label: 'Light' },
|
|
196
|
+
{ value: 'high-contrast', label: 'High contrast' },
|
|
197
|
+
];
|
|
198
|
+
theme.value = 'contraagent-dark';
|
|
199
|
+
theme.addEventListener('cae-change', (e) => {
|
|
200
|
+
theme.value = e.detail.value;
|
|
201
|
+
host.dataset['caTheme'] = e.detail.value;
|
|
202
|
+
});
|
|
203
|
+
page.querySelector('header')!.append(theme);
|
|
204
|
+
|
|
205
|
+
const stats = document.createElement('cae-stat-tiles');
|
|
206
|
+
stats.columns = 4;
|
|
207
|
+
stats.tiles = tiles;
|
|
208
|
+
page.querySelector('header')!.after(stats);
|
|
209
|
+
|
|
210
|
+
const table = document.createElement('cae-data-table') as CaeDataTable<Job>;
|
|
211
|
+
table.caption = 'Jobs of pipeline 482';
|
|
212
|
+
table.columns = columns;
|
|
213
|
+
table.rowKey = (j) => j.id;
|
|
214
|
+
table.rows = jobs;
|
|
215
|
+
table.addEventListener('cae-sort', (e) => {
|
|
216
|
+
table.sort = e.detail;
|
|
217
|
+
table.rows = sortRows(jobs, columns, e.detail);
|
|
218
|
+
});
|
|
219
|
+
tableBox!.append(table);
|
|
220
|
+
|
|
221
|
+
const view = document.createElement('cae-layered-graph');
|
|
222
|
+
view.key = 'pipeline-482'; // a new key is a new graph: the frame shows all of it again
|
|
223
|
+
view.graph = graph;
|
|
224
|
+
view.states = states;
|
|
225
|
+
view.strings = { cycle: 'next pass', badge: 'number of passes' };
|
|
226
|
+
graphBox!.append(view);
|
|
227
|
+
|
|
228
|
+
/** The selection: the graph shows it, the panel describes it. */
|
|
229
|
+
const select = (id: string | null) => {
|
|
230
|
+
view.selected = id;
|
|
231
|
+
detail.replaceChildren(describe(id));
|
|
232
|
+
};
|
|
233
|
+
view.addEventListener('cae-select', (e) => select(e.detail.id));
|
|
234
|
+
// A row of the table selects its job's mark in the graph.
|
|
235
|
+
table.addEventListener('cae-activate', (e) => select(markId(jobs.find((j) => j.id === e.detail.id)!)));
|
|
236
|
+
|
|
237
|
+
host.replaceChildren(page);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** The panel's content for a mark, a node or the loop. */
|
|
241
|
+
function describe(id: string | null): Node {
|
|
242
|
+
const runs = jobs.filter((j) => markId(j) === id);
|
|
243
|
+
const step = steps.find((s) => s.id === id);
|
|
244
|
+
let title = 'No selection';
|
|
245
|
+
let rows: [string, string][] = [];
|
|
246
|
+
if (runs.length) {
|
|
247
|
+
const last = runs[runs.length - 1]!;
|
|
248
|
+
title = jobName(last);
|
|
249
|
+
rows = [['State', last.state], ['Passes', String(runs.length)], ...runs.map((j): [string, string] => [`Pass ${j.pass}`, `${j.state} | ${fmtDur(j.seconds)} | ${j.runner}`])];
|
|
250
|
+
} else if (step) {
|
|
251
|
+
const own = jobs.filter((j) => j.step === step.id);
|
|
252
|
+
title = step.label;
|
|
253
|
+
rows = [['Jobs', String(own.length)], ['Failed', String(own.filter((j) => j.state === 'failed').length)], ['Time', fmtDur(own.reduce((t, j) => t + j.seconds, 0))]];
|
|
254
|
+
} else if (id === 'retry') {
|
|
255
|
+
title = 'retry loop';
|
|
256
|
+
rows = [['Passes', `${passes} of up to 3`], ['Rerun', jobs.filter((j) => j.pass > 1 && j.shard).map(jobName).join(', ')]];
|
|
257
|
+
}
|
|
258
|
+
const box = document.createElement('div');
|
|
259
|
+
const h = document.createElement('strong');
|
|
260
|
+
h.textContent = title;
|
|
261
|
+
const dl = document.createElement('dl');
|
|
262
|
+
for (const [k, v] of rows) {
|
|
263
|
+
const dt = document.createElement('dt');
|
|
264
|
+
const dd = document.createElement('dd');
|
|
265
|
+
dt.textContent = k;
|
|
266
|
+
dd.textContent = v;
|
|
267
|
+
dl.append(dt, dd);
|
|
268
|
+
}
|
|
269
|
+
box.append(h, dl);
|
|
270
|
+
return box;
|
|
271
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// A data table: hand-written rows, one sortable column, a row's action. The
|
|
2
|
+
// host holds the rows and the order, and answers the events.
|
|
3
|
+
import '@contraagent/elements/data-table/define';
|
|
4
|
+
import { sortRows, type CaeDataTable, type DataColumn } from '@contraagent/elements/data-table';
|
|
5
|
+
import { pill } from '@contraagent/elements';
|
|
6
|
+
|
|
7
|
+
interface Job {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
minutes: number;
|
|
11
|
+
state: 'done' | 'failed' | 'running';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const jobs: Job[] = [
|
|
15
|
+
{ id: 'j1', name: 'Build', minutes: 4, state: 'done' },
|
|
16
|
+
{ id: 'j2', name: 'Unit tests', minutes: 11, state: 'failed' },
|
|
17
|
+
{ id: 'j3', name: 'Deploy preview', minutes: 2, state: 'running' },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const columns: DataColumn<Job>[] = [
|
|
21
|
+
{ id: 'name', header: 'Job', rowHeader: true, cell: (j) => j.name },
|
|
22
|
+
{ id: 'minutes', header: 'Minutes', align: 'end', width: '96px', cell: (j) => j.minutes, compare: (a, b) => a.minutes - b.minutes },
|
|
23
|
+
{ id: 'state', header: 'State', width: '120px', cell: (j) => pill({ text: j.state, tone: j.state }) },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export function mount(host: HTMLElement): void {
|
|
27
|
+
const table = document.createElement('cae-data-table') as CaeDataTable<Job>;
|
|
28
|
+
table.caption = 'Jobs';
|
|
29
|
+
table.columns = columns;
|
|
30
|
+
table.rowKey = (j) => j.id;
|
|
31
|
+
table.rows = jobs;
|
|
32
|
+
table.addEventListener('cae-sort', (e) => {
|
|
33
|
+
table.sort = e.detail;
|
|
34
|
+
table.rows = sortRows(jobs, columns, e.detail);
|
|
35
|
+
});
|
|
36
|
+
const shown = document.createElement('p');
|
|
37
|
+
table.addEventListener('cae-activate', (e) => (shown.textContent = `Opened: ${e.detail.id}`));
|
|
38
|
+
host.replaceChildren(table, shown);
|
|
39
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// A layered graph: a hand-written build pipeline of three steps, the last two in a
|
|
2
|
+
// cluster that repeats (a retry loop), one mark per service in each step. The host
|
|
3
|
+
// keeps the selection and the order, and answers the events.
|
|
4
|
+
import '@contraagent/elements/graph/define';
|
|
5
|
+
import type { GraphInput, GraphMark, GraphNodeInput } from '@contraagent/elements/graph';
|
|
6
|
+
import type { StateStyles } from '@contraagent/elements/primitives';
|
|
7
|
+
|
|
8
|
+
const states: StateStyles = {
|
|
9
|
+
ok: { label: 'ok', tone: 'done', shape: 'round', rank: 0 },
|
|
10
|
+
busy: { label: 'busy', tone: 'running', shape: 'round', rank: 2 },
|
|
11
|
+
broken: { label: 'broken', tone: 'failed', shape: 'square', rank: 3 },
|
|
12
|
+
queued: { label: 'queued', tone: 'neutral', shape: 'ring', rank: 1 },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const services = ['api', 'web', 'worker'];
|
|
16
|
+
|
|
17
|
+
/** One mark per service: its id is unique in the graph, so it is what the graph selects. */
|
|
18
|
+
const marks = (step: string, looks: string[]): GraphMark[] =>
|
|
19
|
+
services.map((s, i) => ({ id: `${step}#${s}`, state: looks[i] ?? 'queued', label: `${step} · ${s} | ${looks[i] ?? 'queued'}`, tip: `${step} · ${s}` }));
|
|
20
|
+
|
|
21
|
+
/** A step: its counts and its header's count ("2/3") come from its marks. */
|
|
22
|
+
const node = (id: string, label: string, looks: string[], cluster: string | null): GraphNodeInput => ({ id, label, cluster, marks: marks(id, looks) });
|
|
23
|
+
|
|
24
|
+
const graph: GraphInput = {
|
|
25
|
+
series: services,
|
|
26
|
+
nodes: [
|
|
27
|
+
node('build', 'build', ['ok', 'ok', 'ok'], null),
|
|
28
|
+
node('test', 'test', ['ok', 'broken', 'ok'], 'retry'),
|
|
29
|
+
node('deploy', 'deploy', ['busy', 'queued', 'ok'], 'retry'),
|
|
30
|
+
],
|
|
31
|
+
clusters: [{ id: 'retry', parent: null, label: 'retry', note: 'up to 3 rounds', cycle: true }],
|
|
32
|
+
edges: [
|
|
33
|
+
{ from: 'build', to: 'test', style: 'solid', weight: 3, ranks: true },
|
|
34
|
+
{ from: 'test', to: 'deploy', style: 'solid', weight: 3, ranks: true },
|
|
35
|
+
// The next round: back from deploy to test; it does not set the layers.
|
|
36
|
+
{ from: 'deploy', to: 'test', style: 'solid', weight: 1, ranks: false },
|
|
37
|
+
],
|
|
38
|
+
stubs: [{ id: 'commit', label: 'commit', to: 'build', style: 'solid', weight: 1 }],
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function mount(host: HTMLElement): void {
|
|
42
|
+
const el = document.createElement('cae-layered-graph');
|
|
43
|
+
el.graph = graph;
|
|
44
|
+
el.states = states;
|
|
45
|
+
el.key = 'pipeline';
|
|
46
|
+
el.strings = { cycle: 'next round' };
|
|
47
|
+
const card = document.createElement('div');
|
|
48
|
+
card.slot = 'inspector';
|
|
49
|
+
el.append(card);
|
|
50
|
+
const shown = document.createElement('p');
|
|
51
|
+
el.addEventListener('cae-select', (e) => {
|
|
52
|
+
el.selected = e.detail.id;
|
|
53
|
+
card.innerHTML = e.detail.id ? `<h4>${e.detail.id}</h4>` : '';
|
|
54
|
+
});
|
|
55
|
+
el.addEventListener('cae-activate', (e) => (shown.textContent = `Opened: ${e.detail.id}`));
|
|
56
|
+
host.replaceChildren(el, shown);
|
|
57
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Lanes: hand-written jobs on a time axis, a lane per stage, one job running.
|
|
2
|
+
// The host names the looks of the bars; their labels are the legend.
|
|
3
|
+
import '@contraagent/elements/lanes/define';
|
|
4
|
+
import type { Lane, LaneStyle } from '@contraagent/elements/lanes';
|
|
5
|
+
|
|
6
|
+
const barStyles: Record<string, LaneStyle> = {
|
|
7
|
+
passed: { label: 'passed', color: 'var(--ca-status-done)' },
|
|
8
|
+
failed: { label: 'failed', color: 'var(--ca-status-failed)', pattern: 'hatched' },
|
|
9
|
+
running: { label: 'running', color: 'var(--ca-status-running)', pattern: 'striped' },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function mount(host: HTMLElement): void {
|
|
13
|
+
const now = Date.now();
|
|
14
|
+
const min = 60e3;
|
|
15
|
+
const lanes: Lane[] = [
|
|
16
|
+
{
|
|
17
|
+
id: 'build',
|
|
18
|
+
label: 'Build',
|
|
19
|
+
bars: [
|
|
20
|
+
{ id: 'b1', start: now - 9 * min, end: now - 6 * min, style: 'failed', label: 'Build #1\nfailed' },
|
|
21
|
+
{ id: 'b2', start: now - 6 * min, end: now - 3 * min, style: 'passed', label: 'Build #2\npassed' },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'test',
|
|
26
|
+
label: 'Test',
|
|
27
|
+
bars: [
|
|
28
|
+
{ id: 't1', start: now - 3 * min, end: null, style: 'running', label: 'Unit tests\nrunning' },
|
|
29
|
+
{ id: 't2', start: now - 2.5 * min, end: now - 1 * min, style: 'passed', label: 'Lint\npassed' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
const el = document.createElement('cae-lanes');
|
|
34
|
+
el.lanes = lanes;
|
|
35
|
+
el.barStyles = barStyles;
|
|
36
|
+
el.live = true;
|
|
37
|
+
el.omitted = 3;
|
|
38
|
+
el.strings = { omitted: (n) => `${n} older jobs not shown` };
|
|
39
|
+
host.replaceChildren(el);
|
|
40
|
+
}
|