@contraagent/elements 0.0.0-stage → 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 +83 -2
- package/custom-elements.json +5022 -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/code/code.d.ts +83 -0
- package/dist/code/code.d.ts.map +1 -0
- package/dist/code/code.js +206 -0
- package/dist/code/code.js.map +1 -0
- package/dist/code/highlight.d.ts +25 -0
- package/dist/code/highlight.d.ts.map +1 -0
- package/dist/code/highlight.js +312 -0
- package/dist/code/highlight.js.map +1 -0
- package/dist/code/index.d.ts +3 -0
- package/dist/code/index.d.ts.map +1 -0
- package/dist/code/index.js +5 -0
- package/dist/code/index.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 +15 -0
- package/dist/define/all.d.ts.map +1 -0
- package/dist/define/all.js +16 -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/code.d.ts +4 -0
- package/dist/define/code.d.ts.map +1 -0
- package/dist/define/code.js +7 -0
- package/dist/define/code.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/define/tree.d.ts +4 -0
- package/dist/define/tree.d.ts.map +1 -0
- package/dist/define/tree.js +7 -0
- package/dist/define/tree.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 +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -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 +2 -0
- package/dist/markdown/highlight.d.ts.map +1 -0
- package/dist/markdown/highlight.js +3 -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 +64 -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/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/index.js +4 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/tree.d.ts +83 -0
- package/dist/tree/tree.d.ts.map +1 -0
- package/dist/tree/tree.js +251 -0
- package/dist/tree/tree.js.map +1 -0
- package/docs/charts.md +58 -0
- package/docs/check-table.md +40 -0
- package/docs/code.md +55 -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/code.ts +28 -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/examples/tree.ts +44 -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/tree.md +44 -0
- package/docs/tsconfig.json +20 -0
- package/package.json +177 -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/code/code.ts +199 -0
- package/src/code/highlight.ts +378 -0
- package/src/code/index.ts +4 -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 +15 -0
- package/src/define/charts.ts +17 -0
- package/src/define/check-table.ts +9 -0
- package/src/define/code.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/define/tree.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 +27 -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 +2 -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 +64 -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/src/tree/index.ts +3 -0
- package/src/tree/tree.ts +263 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, nothing, svg } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { ChartElement } from './base.js';
|
|
10
|
+
import { LABEL_GAP, labelStride } from './scale.js';
|
|
11
|
+
/** One hue, light to dark: a value's share of the colour, by its step of five. */
|
|
12
|
+
export const HEAT_STEPS = [16, 34, 52, 72, 92];
|
|
13
|
+
/** The hue of the scale. */
|
|
14
|
+
const HUE = 'var(--series-1)';
|
|
15
|
+
const CELL_H = 22;
|
|
16
|
+
const GAP = 2;
|
|
17
|
+
const M = { top: 2, right: 2, bottom: 22 };
|
|
18
|
+
/** A colour of the scale: `pct` percent of its hue over the card. */
|
|
19
|
+
export const heatColour = (pct) => `color-mix(in srgb, ${HUE} ${pct}%, var(--card))`;
|
|
20
|
+
/** The step (0..4) of `v` between `low` and `high`. */
|
|
21
|
+
export function heatStep(v, low, high) {
|
|
22
|
+
if (!(high > low))
|
|
23
|
+
return HEAT_STEPS.length - 1;
|
|
24
|
+
const t = (v - low) / (high - low);
|
|
25
|
+
return Math.min(HEAT_STEPS.length - 1, Math.max(0, Math.floor(t * HEAT_STEPS.length)));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A value per row (`y`) and column (`x`), each a cell coloured on one scale, light to
|
|
29
|
+
* dark (`values[row][column]`; a null cell is left empty, a 0 is the lightest step).
|
|
30
|
+
* The legend gives the scale's lowest and highest value. Pointing at a cell, or moving
|
|
31
|
+
* to it with the arrow keys (up and down by a row), shows its row, column and value;
|
|
32
|
+
* the switch shows them all as a table.
|
|
33
|
+
*
|
|
34
|
+
* @tagname cae-heatmap
|
|
35
|
+
* @csspart plot - the chart
|
|
36
|
+
* @csspart table - the table of its values
|
|
37
|
+
* @csspart switch - the button between the two
|
|
38
|
+
* @csspart empty - what it shows with no values
|
|
39
|
+
* @csspart legend - the legend
|
|
40
|
+
*/
|
|
41
|
+
export class CaeHeatmap extends ChartElement {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
this.x = [];
|
|
45
|
+
this.y = [];
|
|
46
|
+
this.values = [];
|
|
47
|
+
}
|
|
48
|
+
get range() {
|
|
49
|
+
const all = this.values.flat().filter((v) => v !== null && v !== undefined);
|
|
50
|
+
return all.length ? [Math.min(0, ...all), Math.max(...all)] : [0, 0];
|
|
51
|
+
}
|
|
52
|
+
hasValues() {
|
|
53
|
+
return this.x.length > 0 && this.y.length > 0 && this.values.some((r) => r.some((v) => v !== null && v !== undefined));
|
|
54
|
+
}
|
|
55
|
+
legendItems() {
|
|
56
|
+
const [low, high] = this.range;
|
|
57
|
+
const strip = html `<span class="scale" aria-hidden="true">${HEAT_STEPS.map((p) => html `<i style="background: ${heatColour(p)}"></i>`)}</span>`;
|
|
58
|
+
return [{ label: this.words.scale(this.format(low), this.format(high)), icon: strip }];
|
|
59
|
+
}
|
|
60
|
+
itemCount() {
|
|
61
|
+
return this.x.length * this.y.length;
|
|
62
|
+
}
|
|
63
|
+
rowLength() {
|
|
64
|
+
return this.x.length;
|
|
65
|
+
}
|
|
66
|
+
plot() {
|
|
67
|
+
const nx = this.x.length;
|
|
68
|
+
const ny = this.y.length;
|
|
69
|
+
const [low, high] = this.range;
|
|
70
|
+
const left = Math.max(...this.y.map((s) => this.labelWidth(s))) + 2;
|
|
71
|
+
const w = this.plotWidth;
|
|
72
|
+
const pw = w - left - M.right;
|
|
73
|
+
const cw = pw / nx;
|
|
74
|
+
const h = M.top + ny * CELL_H + M.bottom;
|
|
75
|
+
const stride = labelStride(nx, pw, Math.max(...this.x.map((s) => this.labelWidth(s))) + LABEL_GAP);
|
|
76
|
+
const a = this.active;
|
|
77
|
+
const cells = [];
|
|
78
|
+
for (let r = 0; r < ny; r++)
|
|
79
|
+
for (let c = 0; c < nx; c++) {
|
|
80
|
+
const v = this.values[r]?.[c];
|
|
81
|
+
const x = left + c * cw;
|
|
82
|
+
const y = M.top + r * CELL_H;
|
|
83
|
+
const i = r * nx + c;
|
|
84
|
+
cells.push(v === null || v === undefined
|
|
85
|
+
? svg `<rect x=${x + GAP / 2} y=${y + GAP / 2} width=${Math.max(1, cw - GAP)} height=${CELL_H - GAP} rx="2" fill="none" stroke="var(--line)"
|
|
86
|
+
@mouseenter=${() => (this.active = i)}></rect>`
|
|
87
|
+
: svg `<rect x=${x + GAP / 2} y=${y + GAP / 2} width=${Math.max(1, cw - GAP)} height=${CELL_H - GAP} rx="2"
|
|
88
|
+
fill=${heatColour(HEAT_STEPS[heatStep(v, low, high)] ?? 92)} stroke=${a === i ? 'var(--text)' : 'none'} stroke-width="1.5"
|
|
89
|
+
@mouseenter=${() => (this.active = i)}></rect>`);
|
|
90
|
+
}
|
|
91
|
+
const at = a !== null && a < nx * ny ? { r: Math.floor(a / nx), c: a % nx } : null;
|
|
92
|
+
return html `<svg width=${w} height=${h} role="img" aria-label=${this.label || nothing}>
|
|
93
|
+
${this.y.map((label, r) => svg `<text class="axis" x=${left - 6} y=${M.top + r * CELL_H + CELL_H / 2} dy="0.32em" text-anchor="end">${label}</text>`)}
|
|
94
|
+
${cells}
|
|
95
|
+
${this.x.map((label, c) => c % stride === 0 ? svg `<text class="axis" x=${left + c * cw + cw / 2} y=${h - 6} text-anchor="middle">${label}</text>` : nothing)}
|
|
96
|
+
</svg>
|
|
97
|
+
${at ? this.tip(left + at.c * cw + cw / 2, M.top + (at.r + 1) * CELL_H, this.tipBody(at.r, at.c)) : nothing}`;
|
|
98
|
+
}
|
|
99
|
+
tipBody(r, c) {
|
|
100
|
+
const v = this.values[r]?.[c];
|
|
101
|
+
return html `<b>${this.y[r]} | ${this.x[c]}</b>
|
|
102
|
+
<div class="row"><span>${v === null || v === undefined ? this.words.none : this.format(v)}</span></div>`;
|
|
103
|
+
}
|
|
104
|
+
table() {
|
|
105
|
+
const none = this.words.none;
|
|
106
|
+
return html `<table aria-label=${this.label || nothing}>
|
|
107
|
+
<thead><tr><th scope="col">${this.words.label}</th>${this.x.map((l) => html `<th scope="col">${l}</th>`)}</tr></thead>
|
|
108
|
+
<tbody>${this.y.map((label, r) => html `<tr><th scope="row">${label}</th>${this.x.map((_, c) => {
|
|
109
|
+
const v = this.values[r]?.[c];
|
|
110
|
+
return html `<td>${v === null || v === undefined ? none : this.format(v)}</td>`;
|
|
111
|
+
})}</tr>`)}</tbody>
|
|
112
|
+
</table>`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ attribute: false })
|
|
117
|
+
], CaeHeatmap.prototype, "x", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ attribute: false })
|
|
120
|
+
], CaeHeatmap.prototype, "y", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ attribute: false })
|
|
123
|
+
], CaeHeatmap.prototype, "values", void 0);
|
|
124
|
+
//# sourceMappingURL=heatmap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heatmap.js","sourceRoot":"","sources":["../../src/charts/heatmap.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAuB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEpD,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAU,CAAC;AACxD,4BAA4B;AAC5B,MAAM,GAAG,GAAG,iBAAiB,CAAC;AAC9B,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAE3C,qEAAqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,sBAAsB,GAAG,IAAI,GAAG,iBAAiB,CAAC;AAErG,uDAAuD;AACvD,MAAM,UAAU,QAAQ,CAAC,CAAS,EAAE,GAAW,EAAE,IAAY;IAC3D,IAAI,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC;QAAE,OAA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CAAC,EAAE,EAAE;YACxE,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAA,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACjF,CAAC,CAAC,OAAO,CACV;aACM,CAAC;IACZ,CAAC;CACF;AAnFiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qCAA2B;AAC1B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qCAA2B;AAC1B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;0CAAsD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './scale.js';
|
|
3
|
+
export * from './base.js';
|
|
4
|
+
export * from './column-chart.js';
|
|
5
|
+
export * from './line-chart.js';
|
|
6
|
+
export * from './heatmap.js';
|
|
7
|
+
export * from './state-grid.js';
|
|
8
|
+
export * from './bar-chart.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/charts/index.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Charts of plain series: `@contraagent/elements/charts`. The elements are registered
|
|
2
|
+
// by `@contraagent/elements/charts/define`.
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './scale.js';
|
|
5
|
+
export * from './base.js';
|
|
6
|
+
export * from './column-chart.js';
|
|
7
|
+
export * from './line-chart.js';
|
|
8
|
+
export * from './heatmap.js';
|
|
9
|
+
export * from './state-grid.js';
|
|
10
|
+
export * from './bar-chart.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/charts/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,4CAA4C;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import type { LegendItem } from '../primitives/legend.js';
|
|
3
|
+
import { ChartElement } from './base.js';
|
|
4
|
+
import type { ChartSeries } from './types.js';
|
|
5
|
+
/** The path of a series: a line through its values, broken where a value is null. */
|
|
6
|
+
export declare function linePath(points: readonly ([number, number] | null)[]): string;
|
|
7
|
+
/**
|
|
8
|
+
* Lines over the labels of `x`, one per series (a value per label; null breaks the
|
|
9
|
+
* line). Six series take the series colours in their order; any past six are drawn in
|
|
10
|
+
* the colour of "other" and named in the legend and the tooltip. Pointing at a label,
|
|
11
|
+
* or moving to it with the arrow keys, marks it with a rule and shows every series'
|
|
12
|
+
* value there; the switch shows them all as a table.
|
|
13
|
+
*
|
|
14
|
+
* @tagname cae-line-chart
|
|
15
|
+
* @csspart plot - the chart
|
|
16
|
+
* @csspart table - the table of its values
|
|
17
|
+
* @csspart switch - the button between the two
|
|
18
|
+
* @csspart empty - what it shows with no values
|
|
19
|
+
* @csspart legend - the legend
|
|
20
|
+
*/
|
|
21
|
+
export declare class CaeLineChart extends ChartElement {
|
|
22
|
+
x: readonly string[];
|
|
23
|
+
series: readonly ChartSeries[];
|
|
24
|
+
protected hasValues(): boolean;
|
|
25
|
+
protected legendItems(): LegendItem[];
|
|
26
|
+
protected itemCount(): number;
|
|
27
|
+
protected plot(): TemplateResult;
|
|
28
|
+
private tipBody;
|
|
29
|
+
protected table(): TemplateResult;
|
|
30
|
+
}
|
|
31
|
+
declare global {
|
|
32
|
+
interface HTMLElementTagNameMap {
|
|
33
|
+
'cae-line-chart': CaeLineChart;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=line-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-chart.d.ts","sourceRoot":"","sources":["../../src/charts/line-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,qFAAqF;AACrF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,CAY7E;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,YAAa,SAAQ,YAAY;IACZ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAM;IAC1B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAM;IAEpE,SAAS,CAAC,SAAS,IAAI,OAAO;IAI9B,SAAS,CAAC,WAAW,IAAI,UAAU,EAAE;IAIrC,SAAS,CAAC,SAAS,IAAI,MAAM;IAI7B,SAAS,CAAC,IAAI,IAAI,cAAc;IAmDhC,OAAO,CAAC,OAAO;IAMf,SAAS,CAAC,KAAK,IAAI,cAAc;CAUlC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, nothing, svg } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { ChartElement } from './base.js';
|
|
10
|
+
import { LABEL_GAP, labelStride, niceAxis, seriesColour } from './scale.js';
|
|
11
|
+
const M = { top: 8, right: 10, bottom: 22 };
|
|
12
|
+
/** The path of a series: a line through its values, broken where a value is null. */
|
|
13
|
+
export function linePath(points) {
|
|
14
|
+
let d = '';
|
|
15
|
+
let open = false;
|
|
16
|
+
for (const p of points) {
|
|
17
|
+
if (!p) {
|
|
18
|
+
open = false;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
d += `${open ? 'L' : 'M'}${p[0].toFixed(1)},${p[1].toFixed(1)}`;
|
|
22
|
+
open = true;
|
|
23
|
+
}
|
|
24
|
+
return d;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Lines over the labels of `x`, one per series (a value per label; null breaks the
|
|
28
|
+
* line). Six series take the series colours in their order; any past six are drawn in
|
|
29
|
+
* the colour of "other" and named in the legend and the tooltip. Pointing at a label,
|
|
30
|
+
* or moving to it with the arrow keys, marks it with a rule and shows every series'
|
|
31
|
+
* value there; the switch shows them all as a table.
|
|
32
|
+
*
|
|
33
|
+
* @tagname cae-line-chart
|
|
34
|
+
* @csspart plot - the chart
|
|
35
|
+
* @csspart table - the table of its values
|
|
36
|
+
* @csspart switch - the button between the two
|
|
37
|
+
* @csspart empty - what it shows with no values
|
|
38
|
+
* @csspart legend - the legend
|
|
39
|
+
*/
|
|
40
|
+
export class CaeLineChart extends ChartElement {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.x = [];
|
|
44
|
+
this.series = [];
|
|
45
|
+
}
|
|
46
|
+
hasValues() {
|
|
47
|
+
return this.x.length > 0 && this.series.some((s) => s.values.some((v) => v !== null && v !== undefined));
|
|
48
|
+
}
|
|
49
|
+
legendItems() {
|
|
50
|
+
return this.series.length > 1 ? this.series.map((s, i) => ({ label: s.name, swatch: seriesColour(i) })) : [];
|
|
51
|
+
}
|
|
52
|
+
itemCount() {
|
|
53
|
+
return this.x.length;
|
|
54
|
+
}
|
|
55
|
+
plot() {
|
|
56
|
+
const n = this.x.length;
|
|
57
|
+
const values = this.series.flatMap((s) => s.values.filter((v) => v !== null && v !== undefined));
|
|
58
|
+
const axis = niceAxis(Math.min(0, ...values), Math.max(0, ...values));
|
|
59
|
+
const left = Math.max(...axis.ticks.map((t) => this.labelWidth(this.format(t)))) + 4;
|
|
60
|
+
const w = this.plotWidth;
|
|
61
|
+
const h = this.height;
|
|
62
|
+
const pw = w - left - M.right;
|
|
63
|
+
const ph = h - M.top - M.bottom;
|
|
64
|
+
const step = n > 1 ? pw / (n - 1) : 0;
|
|
65
|
+
const px = (j) => (n > 1 ? left + j * step : left + pw / 2);
|
|
66
|
+
const py = (v) => M.top + ph - ((v - axis.min) / (axis.max - axis.min)) * ph;
|
|
67
|
+
const stride = labelStride(n, pw, Math.max(...this.x.map((s) => this.labelWidth(s))) + LABEL_GAP);
|
|
68
|
+
const a = this.active;
|
|
69
|
+
const hitW = n > 1 ? step : pw;
|
|
70
|
+
return html `<svg width=${w} height=${h} role="img" aria-label=${this.label || nothing}>
|
|
71
|
+
${axis.ticks.map((t) => svg `<line class=${t === 0 ? 'base' : 'grid'} x1=${left} x2=${w - M.right} y1=${py(t)} y2=${py(t)}></line>
|
|
72
|
+
<text class="axis" x=${left - 6} y=${py(t)} dy="0.32em" text-anchor="end">${this.format(t)}</text>`)}
|
|
73
|
+
${a !== null ? svg `<line class="base" x1=${px(a)} x2=${px(a)} y1=${M.top} y2=${M.top + ph}></line>` : nothing}
|
|
74
|
+
${this.series.map((s, i) => {
|
|
75
|
+
const pts = this.x.map((_, j) => {
|
|
76
|
+
const v = s.values[j];
|
|
77
|
+
return v === null || v === undefined ? null : [px(j), py(v)];
|
|
78
|
+
});
|
|
79
|
+
const lone = pts.filter((p, j) => p && !pts[j - 1] && !pts[j + 1]);
|
|
80
|
+
return svg `<path d=${linePath(pts)} fill="none" stroke=${seriesColour(i)} stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path>
|
|
81
|
+
${lone.map((p) => svg `<circle cx=${p[0]} cy=${p[1]} r="2.5" fill=${seriesColour(i)}></circle>`)}`;
|
|
82
|
+
})}
|
|
83
|
+
${a !== null
|
|
84
|
+
? this.series.map((s, i) => {
|
|
85
|
+
const v = s.values[a];
|
|
86
|
+
return v === null || v === undefined
|
|
87
|
+
? nothing
|
|
88
|
+
: svg `<circle cx=${px(a)} cy=${py(v)} r="4.5" fill=${seriesColour(i)} stroke="var(--card)" stroke-width="2"></circle>`;
|
|
89
|
+
})
|
|
90
|
+
: nothing}
|
|
91
|
+
${this.x.map((label, j) => j % stride === 0
|
|
92
|
+
? svg `<text class="axis" x=${px(j)} y=${h - 6} text-anchor=${n > 1 && j === 0 ? 'start' : n > 1 && j === n - 1 ? 'end' : 'middle'}>${label}</text>`
|
|
93
|
+
: nothing)}
|
|
94
|
+
${this.x.map((_, j) => svg `<rect class="hit" x=${px(j) - hitW / 2} y=${M.top} width=${hitW} height=${ph + M.bottom}
|
|
95
|
+
@mouseenter=${() => (this.active = j)}></rect>`)}
|
|
96
|
+
</svg>
|
|
97
|
+
${a !== null && a < n ? this.tip(px(a), M.top, this.tipBody(a)) : nothing}`;
|
|
98
|
+
}
|
|
99
|
+
tipBody(j) {
|
|
100
|
+
const none = this.words.none;
|
|
101
|
+
return html `<b>${this.x[j]}</b>
|
|
102
|
+
${this.series.map((s, i) => this.tipRow(seriesColour(i), s.name, s.values[j] === null || s.values[j] === undefined ? none : this.format(s.values[j])))}`;
|
|
103
|
+
}
|
|
104
|
+
table() {
|
|
105
|
+
const none = this.words.none;
|
|
106
|
+
return html `<table aria-label=${this.label || nothing}>
|
|
107
|
+
<thead><tr><th scope="col">${this.words.label}</th>${this.series.map((s) => html `<th scope="col">${s.name}</th>`)}</tr></thead>
|
|
108
|
+
<tbody>${this.x.map((label, j) => html `<tr><th scope="row">${label}</th>${this.series.map((s) => html `<td>${s.values[j] === null || s.values[j] === undefined ? none : this.format(s.values[j])}</td>`)}</tr>`)}</tbody>
|
|
109
|
+
</table>`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ attribute: false })
|
|
114
|
+
], CaeLineChart.prototype, "x", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ attribute: false })
|
|
117
|
+
], CaeLineChart.prototype, "series", void 0);
|
|
118
|
+
//# sourceMappingURL=line-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-chart.js","sourceRoot":"","sources":["../../src/charts/line-chart.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAuB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAA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CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAC/K;aACM,CAAC;IACZ,CAAC;CACF;AAlFiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uCAA2B;AAC1B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;4CAAqC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ChartSeries } from './types.js';
|
|
2
|
+
/** The series colours (`--series-1` ...), in their fixed order. */
|
|
3
|
+
export declare const SERIES_COLOURS = 6;
|
|
4
|
+
/** The colour of the series folded past the sixth, and of anything that is not a series. */
|
|
5
|
+
export declare const OTHER_COLOUR = "var(--meter)";
|
|
6
|
+
/** Series `i`'s colour: the series colours in order, then the colour of "other". */
|
|
7
|
+
export declare const seriesColour: (i: number) => string;
|
|
8
|
+
/** A series with its colour. */
|
|
9
|
+
export interface DrawnSeries extends ChartSeries {
|
|
10
|
+
colour: string;
|
|
11
|
+
/** It stands for several series, folded into one. */
|
|
12
|
+
folded?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The series as drawn: the first six each in its own colour, by their order (a series
|
|
16
|
+
* keeps its colour whatever its values); with more than six, the sixth and later are
|
|
17
|
+
* summed into one series named `other`, so no colour is ever made up.
|
|
18
|
+
*/
|
|
19
|
+
export declare function foldSeries(series: readonly ChartSeries[], other: string): DrawnSeries[];
|
|
20
|
+
/** An axis from `low` (0 or below) to a round number at or above `high`, and its ticks (`count` or so). */
|
|
21
|
+
export declare function niceAxis(low: number, high: number, count?: number): {
|
|
22
|
+
min: number;
|
|
23
|
+
max: number;
|
|
24
|
+
ticks: number[];
|
|
25
|
+
};
|
|
26
|
+
/** The space kept between two labels of an axis, in px. */
|
|
27
|
+
export declare const LABEL_GAP = 12;
|
|
28
|
+
/** Every `k`-th label of `n` fits in `width` px when a label is `labelWidth` px wide: the smallest such `k`. */
|
|
29
|
+
export declare function labelStride(n: number, width: number, labelWidth: number): number;
|
|
30
|
+
/** A number as written when the host gives no format: up to two decimals. */
|
|
31
|
+
export declare const plainNumber: (v: number) => string;
|
|
32
|
+
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/charts/scale.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,mEAAmE;AACnE,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,4FAA4F;AAC5F,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,oFAAoF;AACpF,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MAAwE,CAAC;AAElH,gCAAgC;AAChC,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,CAUvF;AAED,2GAA2G;AAC3G,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAY5G;AAED,2DAA2D;AAC3D,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,gHAAgH;AAChH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAGhF;AAED,6EAA6E;AAC7E,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,KAAG,MAA2C,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** The series colours (`--series-1` ...), in their fixed order. */
|
|
2
|
+
export const SERIES_COLOURS = 6;
|
|
3
|
+
/** The colour of the series folded past the sixth, and of anything that is not a series. */
|
|
4
|
+
export const OTHER_COLOUR = 'var(--meter)';
|
|
5
|
+
/** Series `i`'s colour: the series colours in order, then the colour of "other". */
|
|
6
|
+
export const seriesColour = (i) => (i < SERIES_COLOURS ? `var(--series-${i + 1})` : OTHER_COLOUR);
|
|
7
|
+
/**
|
|
8
|
+
* The series as drawn: the first six each in its own colour, by their order (a series
|
|
9
|
+
* keeps its colour whatever its values); with more than six, the sixth and later are
|
|
10
|
+
* summed into one series named `other`, so no colour is ever made up.
|
|
11
|
+
*/
|
|
12
|
+
export function foldSeries(series, other) {
|
|
13
|
+
if (series.length <= SERIES_COLOURS)
|
|
14
|
+
return series.map((s, i) => ({ ...s, colour: seriesColour(i) }));
|
|
15
|
+
const own = series.slice(0, SERIES_COLOURS - 1).map((s, i) => ({ ...s, colour: seriesColour(i) }));
|
|
16
|
+
const rest = series.slice(SERIES_COLOURS - 1);
|
|
17
|
+
const n = Math.max(...rest.map((s) => s.values.length));
|
|
18
|
+
const values = Array.from({ length: n }, (_, j) => {
|
|
19
|
+
const vs = rest.map((s) => s.values[j]).filter((v) => v !== null && v !== undefined);
|
|
20
|
+
return vs.length ? vs.reduce((a, v) => a + v, 0) : null;
|
|
21
|
+
});
|
|
22
|
+
return [...own, { name: other, values, colour: OTHER_COLOUR, folded: rest.map((s) => s.name) }];
|
|
23
|
+
}
|
|
24
|
+
/** An axis from `low` (0 or below) to a round number at or above `high`, and its ticks (`count` or so). */
|
|
25
|
+
export function niceAxis(low, high, count = 4) {
|
|
26
|
+
const lo = Math.min(0, low);
|
|
27
|
+
const hi = Math.max(0, high);
|
|
28
|
+
if (!(hi > lo))
|
|
29
|
+
return { min: 0, max: 1, ticks: [0, 1] };
|
|
30
|
+
const raw = (hi - lo) / count;
|
|
31
|
+
const mag = 10 ** Math.floor(Math.log10(raw));
|
|
32
|
+
const step = [1, 2, 2.5, 5, 10].map((m) => m * mag).find((s) => s >= raw) ?? 10 * mag;
|
|
33
|
+
const min = Math.floor(lo / step) * step;
|
|
34
|
+
const max = Math.ceil(hi / step) * step;
|
|
35
|
+
const ticks = [];
|
|
36
|
+
for (let v = min; v <= max + step / 2; v += step)
|
|
37
|
+
ticks.push(Math.round(v / step) * step);
|
|
38
|
+
return { min, max, ticks };
|
|
39
|
+
}
|
|
40
|
+
/** The space kept between two labels of an axis, in px. */
|
|
41
|
+
export const LABEL_GAP = 12;
|
|
42
|
+
/** Every `k`-th label of `n` fits in `width` px when a label is `labelWidth` px wide: the smallest such `k`. */
|
|
43
|
+
export function labelStride(n, width, labelWidth) {
|
|
44
|
+
if (n <= 0 || width <= 0)
|
|
45
|
+
return 1;
|
|
46
|
+
return Math.max(1, Math.ceil((n * labelWidth) / width));
|
|
47
|
+
}
|
|
48
|
+
/** A number as written when the host gives no format: up to two decimals. */
|
|
49
|
+
export const plainNumber = (v) => String(Math.round(v * 100) / 100);
|
|
50
|
+
//# sourceMappingURL=scale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.js","sourceRoot":"","sources":["../../src/charts/scale.ts"],"names":[],"mappings":"AAGA,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAChC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAE3C,oFAAoF;AACpF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,gBAAg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,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1F,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAE5B,gHAAgH;AAChH,MAAM,UAAU,WAAW,CAAC,CAAS,EAAE,KAAa,EAAE,UAAkB;IACtE,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import type { Tone } from '../core/tone.js';
|
|
3
|
+
import type { LegendItem } from '../primitives/legend.js';
|
|
4
|
+
import { ChartElement } from './base.js';
|
|
5
|
+
/** One cell of a state grid: its state in words, the tone that colours it, and a fact of its own for the tooltip. */
|
|
6
|
+
export interface StateCell {
|
|
7
|
+
label: string;
|
|
8
|
+
tone: Tone;
|
|
9
|
+
tip?: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A tone's fill: a failure and what needs attention stand out, a cell that ended well
|
|
13
|
+
* stays quiet, so the exceptions are what the eye finds first.
|
|
14
|
+
*/
|
|
15
|
+
export declare function stateFill(tone: Tone): string;
|
|
16
|
+
/** The mark a tone takes in a cell, beside its colour: ✓ done, ✕ failed, ◌ attention; none for the others. */
|
|
17
|
+
export declare function stateMark(tone: Tone): string;
|
|
18
|
+
/** The textures that tell the states of one tone apart, after the first (plain): stripes, dots, crosshatch, lines. */
|
|
19
|
+
export declare const TEXTURES: readonly ["", "stripes", "dots", "cross", "lines"];
|
|
20
|
+
export type Texture = (typeof TEXTURES)[number];
|
|
21
|
+
/** Each state's texture, by `tone` and `label`: the first state of a tone plain, the next ones in `TEXTURES` order (again from the start past the fifth). */
|
|
22
|
+
export declare function texturesOf(states: readonly StateCell[]): Map<string, Texture>;
|
|
23
|
+
/** Each state of the cells once: by tone (failed, attention, running, done, muted, neutral), then in the order the cells first give it. */
|
|
24
|
+
export declare function statesOf(cells: readonly (readonly (StateCell | null | undefined)[])[]): StateCell[];
|
|
25
|
+
/**
|
|
26
|
+
* A state per row (`y`) and column (`x`), each cell coloured by its tone
|
|
27
|
+
* (`cells[row][column]`; a null cell is left empty): the states of hourly runs by day,
|
|
28
|
+
* say. The colour is never alone: a cell wide enough holds its tone's mark (✓ ✕ ◌), the
|
|
29
|
+
* states of one tone differ by a texture (the first plain, then stripes, dots,
|
|
30
|
+
* crosshatch, lines), the legend names every state with its texture, and pointing at a cell, or moving to it with the arrow keys
|
|
31
|
+
* (up and down by a row), shows its row, column, state and fact; the switch shows them
|
|
32
|
+
* all as a table of words.
|
|
33
|
+
*
|
|
34
|
+
* @tagname cae-state-grid
|
|
35
|
+
* @csspart plot - the grid
|
|
36
|
+
* @csspart table - the table of its states
|
|
37
|
+
* @csspart switch - the button between the two
|
|
38
|
+
* @csspart empty - what it shows with no cells
|
|
39
|
+
* @csspart legend - the legend
|
|
40
|
+
*/
|
|
41
|
+
export declare class CaeStateGrid extends ChartElement {
|
|
42
|
+
static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
43
|
+
x: readonly string[];
|
|
44
|
+
y: readonly string[];
|
|
45
|
+
cells: readonly (readonly (StateCell | null)[])[];
|
|
46
|
+
protected hasValues(): boolean;
|
|
47
|
+
protected legendItems(): LegendItem[];
|
|
48
|
+
protected itemCount(): number;
|
|
49
|
+
protected rowLength(): number;
|
|
50
|
+
protected plot(): TemplateResult;
|
|
51
|
+
/** One id per element and texture: two grids in a page keep their own patterns. */
|
|
52
|
+
private readonly uid;
|
|
53
|
+
private patternId;
|
|
54
|
+
/** The SVG patterns of the textures in use, drawn in the text's colour over a cell's fill. */
|
|
55
|
+
private patterns;
|
|
56
|
+
private tipBody;
|
|
57
|
+
protected table(): TemplateResult;
|
|
58
|
+
}
|
|
59
|
+
declare global {
|
|
60
|
+
interface HTMLElementTagNameMap {
|
|
61
|
+
'cae-state-grid': CaeStateGrid;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=state-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-grid.d.ts","sourceRoot":"","sources":["../../src/charts/state-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,qHAAqH;AACrH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,G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