@mechane-ai/elements 0.45.0 → 0.47.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 +353 -50
- package/bin/mechane-elements-catalog.mjs +42 -4
- package/dist/ai.js +268 -202
- package/dist/catalog.json +2480 -71
- package/dist/categorical-values-DdfGIowV.js +107 -0
- package/dist/cells--Bd1fQFR.js +384 -0
- package/dist/chart-cursor-1mFd48Jc.js +23 -0
- package/dist/chart-link-AE_xuxiP.js +35 -0
- package/dist/chart-tones-ei3BC2AL.js +27 -0
- package/dist/charts/cartesian.js +1 -2792
- package/dist/charts/cells.js +1 -0
- package/dist/charts/comparison.js +1 -0
- package/dist/charts/distribution.js +1 -709
- package/dist/charts/figure.js +3404 -0
- package/dist/charts/graph.js +1 -641
- package/dist/charts/hierarchy.js +1 -112
- package/dist/charts/image.js +1 -0
- package/dist/charts/matrix.js +3 -637
- package/dist/charts/plot.js +15 -0
- package/dist/charts/relationship.js +1 -0
- package/dist/charts/text.js +1 -0
- package/dist/charts/timeline.js +1 -233
- package/dist/charts/transforms.js +677 -0
- package/dist/charts/trend.js +1 -0
- package/dist/charts.js +8 -3
- package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
- package/dist/collections.js +1 -1735
- package/dist/color-legend-CIo7DhXB.js +62 -0
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +67 -66
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/csp.js +6 -11
- package/dist/dates-Cww8UR_n.js +810 -0
- package/dist/dumbbell-plot-B2ZTgQaI.js +508 -0
- package/dist/embedding-map-CGM_k6lC.js +1929 -0
- package/dist/feedback.js +1 -1
- package/dist/figure-format-B8kRZMlo.js +36 -0
- package/dist/figure-frame-wRkIEAwe.js +270 -0
- package/dist/forms/dates.js +1 -750
- package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
- package/dist/forms.js +3 -3
- package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
- package/dist/image-grid-CVA4SOy_.js +598 -0
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +431 -0
- package/dist/kits/explainers.js +452 -0
- package/dist/kits/interpretability.js +1033 -0
- package/dist/kits/operations.js +239 -0
- package/dist/kits/training.js +335 -0
- package/dist/label-place-Z0fryBZb.js +42 -0
- package/dist/layout.js +207 -207
- package/dist/locate-Bcg3QcP4.js +11 -0
- package/dist/navigation.js +4 -3
- package/dist/packages/ai/src/conversation.d.ts +2 -0
- package/dist/packages/ai/src/prompt-input.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
- package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
- package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
- package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
- package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
- package/dist/packages/charts/src/cartesian/index.d.ts +6 -5
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +37 -26
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
- package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
- package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
- package/dist/packages/charts/src/cartesian/time-series.d.ts +61 -27
- package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
- package/dist/packages/charts/src/categorical-values.d.ts +15 -10
- package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
- package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
- package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
- package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
- package/dist/packages/charts/src/cells/index.d.ts +11 -0
- package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
- package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
- package/dist/packages/charts/src/chart-frame.d.ts +17 -12
- package/dist/packages/charts/src/chart-grid.d.ts +19 -0
- package/dist/packages/charts/src/chart-input.d.ts +1 -9
- package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
- package/dist/packages/charts/src/chart-link.d.ts +56 -0
- package/dist/packages/charts/src/chart-range.d.ts +33 -0
- package/dist/packages/charts/src/chart-rows.d.ts +20 -0
- package/dist/packages/charts/src/chart-theme.d.ts +17 -0
- package/dist/packages/charts/src/chart.d.ts +73 -0
- package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
- package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
- package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
- package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
- package/dist/packages/charts/src/comparison/index.d.ts +6 -0
- package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
- package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
- package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
- package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
- package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
- package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
- package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
- package/dist/packages/charts/src/distribution/index.d.ts +11 -0
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
- package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
- package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
- package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
- package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
- package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
- package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
- package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
- package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
- package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
- package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
- package/dist/packages/charts/src/graph/index.d.ts +6 -2
- package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
- package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
- package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
- package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
- package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
- package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
- package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
- package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
- package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
- package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
- package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
- package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
- package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
- package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
- package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
- package/dist/packages/charts/src/image/image-input.d.ts +27 -0
- package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
- package/dist/packages/charts/src/image/index.d.ts +7 -0
- package/dist/packages/charts/src/index.d.ts +16 -1
- package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
- package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
- package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
- package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
- package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
- package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
- package/dist/packages/charts/src/matrix/index.d.ts +14 -3
- package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
- package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
- package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
- package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
- package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
- package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
- package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
- package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
- package/dist/packages/charts/src/plot/contours.d.ts +45 -0
- package/dist/packages/charts/src/plot/index.d.ts +49 -0
- package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
- package/dist/packages/charts/src/plot/locate.d.ts +18 -0
- package/dist/packages/charts/src/plot/path.d.ts +39 -0
- package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
- package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
- package/dist/packages/charts/src/plot/plot-marks.d.ts +124 -0
- package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
- package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
- package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
- package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
- package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
- package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
- package/dist/packages/charts/src/plot/scale.d.ts +48 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
- package/dist/packages/charts/src/plot-width.d.ts +3 -3
- package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
- package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
- package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
- package/dist/packages/charts/src/relationship/index.d.ts +11 -0
- package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
- package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
- package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
- package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
- package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
- package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
- package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
- package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
- package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
- package/dist/packages/charts/src/spec/figure.d.ts +12 -0
- package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
- package/dist/packages/charts/src/spec/index.d.ts +10 -0
- package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
- package/dist/packages/charts/src/text/index.d.ts +11 -0
- package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
- package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
- package/dist/packages/charts/src/text/token-links.d.ts +49 -0
- package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
- package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
- package/dist/packages/charts/src/text/token-text.d.ts +39 -0
- package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
- package/dist/packages/charts/src/timeline/index.d.ts +3 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +29 -14
- package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
- package/dist/packages/charts/src/transforms/density.d.ts +53 -0
- package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
- package/dist/packages/charts/src/transforms/index.d.ts +19 -0
- package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
- package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
- package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
- package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
- package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
- package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
- package/dist/packages/charts/src/transforms/values.d.ts +70 -0
- package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
- package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
- package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
- package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
- package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
- package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
- package/dist/packages/charts/src/trend/index.d.ts +10 -0
- package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
- package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
- package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
- package/dist/packages/collections/src/collection-controls.d.ts +5 -1
- package/dist/packages/collections/src/collection-filters.d.ts +4 -1
- package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
- package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
- package/dist/packages/collections/src/data-table-text.d.ts +13 -0
- package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -85
- package/dist/packages/collections/src/index.d.ts +11 -6
- package/dist/packages/collections/src/query-controls.d.ts +6 -2
- package/dist/packages/collections/src/table-results.d.ts +47 -13
- package/dist/packages/collections/src/timeline.d.ts +1 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/use-table-window.d.ts +25 -0
- package/dist/packages/content/src/viewer.d.ts +8 -0
- package/dist/packages/core/src/disclosure.d.ts +9 -1
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/route-link.d.ts +11 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
- package/dist/packages/forms/src/file-picker.d.ts +15 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -6
- package/dist/packages/forms/src/forms.d.ts +4 -1
- package/dist/packages/forms/src/index.d.ts +4 -2
- package/dist/packages/forms/src/selection.d.ts +14 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
- package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
- package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
- package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
- package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
- package/dist/packages/kits/src/explainers/bound-value.d.ts +29 -0
- package/dist/packages/kits/src/explainers/figures.d.ts +31 -0
- package/dist/packages/kits/src/explainers/index.d.ts +8 -0
- package/dist/packages/kits/src/explainers/linked-target.d.ts +22 -0
- package/dist/packages/kits/src/explainers/story-steps.d.ts +46 -0
- package/dist/packages/kits/src/explainers/term.d.ts +29 -0
- package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
- package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
- package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
- package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
- package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
- package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
- package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
- package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
- package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
- package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
- package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
- package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
- package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
- package/dist/packages/kits/src/operations/index.d.ts +6 -0
- package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
- package/dist/packages/kits/src/training/index.d.ts +8 -0
- package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
- package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
- package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
- package/dist/packages/kits/src/training/run-state.d.ts +7 -0
- package/dist/packages/kits/src/training/run-table.d.ts +63 -0
- package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
- package/dist/packages/kits/src/training/runs.d.ts +34 -0
- package/dist/packages/navigation/src/index.d.ts +1 -1
- package/dist/path-BglsXpnO.js +59 -0
- package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
- package/dist/plot-axes-DJkLW4wk.js +100 -0
- package/dist/plot-layout-BEuoOHbs.js +911 -0
- package/dist/plot-marks-A64v7aTw.js +226 -0
- package/dist/plot-surface-CJTIqtck.js +51 -0
- package/dist/{plot-width-CIqBiHcd.js → plot-width-DcqtSgzb.js} +22 -3
- package/dist/point-layer-C-EYETAt.js +655 -0
- package/dist/reference-lines-CWA8VeUR.js +82 -0
- package/dist/scale-C2xgZyZN.js +63 -0
- package/dist/slope-chart-DT22h_ym.js +1279 -0
- package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
- package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
- package/dist/{src-Dcs3SZ9V.js → src-CExIrXPC.js} +170 -194
- package/dist/src-CGc_hjxJ.js +409 -0
- package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
- package/dist/src-D5NXRJZe.js +2195 -0
- package/dist/src-DIS0YOj0.js +44 -0
- package/dist/styles2.css +574 -161
- package/dist/time-series-IB3CB93O.js +2668 -0
- package/dist/token-heatmap-C00DnoNO.js +1354 -0
- package/dist/token-predictions-Cxx29iDr.js +1093 -0
- package/dist/tone-scope-DKiSw-JR.js +32 -0
- package/dist/tree-diagram-DsckNKaW.js +1629 -0
- package/dist/treemap-9_DpLCW9.js +472 -0
- package/dist/values-963L6n1m.js +65 -0
- package/dist/violin-plot-BhPHKXsN.js +1291 -0
- package/dist/waterfall-CGksuTy5.js +576 -0
- package/package.json +57 -7
- package/recipes/allocation-report.tsx +15 -7
- package/skills/extend-elements/SKILL.md +134 -0
- package/skills/review-elements/SKILL.md +118 -0
- package/skills/upgrade-elements/SKILL.md +36 -0
- package/skills/upgrade-elements/references/releases.md +242 -0
- package/skills/use-elements/SKILL.md +70 -13
- package/skills/use-elements/references/agent.md +57 -0
- package/skills/use-elements/references/charts.md +384 -0
- package/skills/use-elements/references/collections.md +89 -0
- package/skills/use-elements/references/conversations.md +47 -0
- package/skills/use-elements/references/figures.md +173 -0
- package/skills/use-elements/references/forms.md +81 -0
- package/skills/use-elements/references/kits.md +198 -0
- package/skills/use-elements/references/styling.md +70 -0
- package/skills/use-elements/references/workspace.md +3 -3
- package/dist/categorical-values-DZLGQVW1.js +0 -63
- package/dist/chart-frame-Ztktqs1b.js +0 -255
- package/dist/chart-input-BO3BqlFO.js +0 -22
- package/dist/chart-navigation-BAbb5PV9.js +0 -154
- package/dist/header-styles-COxCYFZx.js +0 -90
- package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
- package/dist/packages/charts/src/chart-surface.d.ts +0 -27
- package/dist/packages/navigation/src/route-link.d.ts +0 -2
- package/dist/src-Bk7M67zy.js +0 -396
|
@@ -1,36 +1,93 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: use-elements
|
|
3
3
|
description:
|
|
4
|
-
Build React pages with Mechane Elements.
|
|
5
|
-
report,
|
|
4
|
+
Build React pages with Mechane Elements. Use when adding or changing UI in an app that has `@mechane-ai/elements`
|
|
5
|
+
installed, such as a table, report, chart, form, workspace shell, conversation, or agent access.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Build with Elements
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Look it up in the installed version
|
|
11
|
+
|
|
12
|
+
From the app with `@mechane-ai/elements` installed, look up the user's task:
|
|
11
13
|
|
|
12
14
|
```sh
|
|
13
15
|
pnpm exec mechane-elements-catalog "searchable table with filters"
|
|
14
16
|
```
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
runs in the Elements Storybook under **Recipes**.
|
|
18
|
-
|
|
18
|
+
The answer is JSON for the installed version: the matching recipes, the best recipe's TSX, and its public imports. Start
|
|
19
|
+
from that TSX. The same example runs in the Elements Storybook under **Recipes**.
|
|
20
|
+
|
|
21
|
+
Look up one component by its export name, without spaces:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pnpm exec mechane-elements-catalog segmentedcontrol
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Each match names its import path and its declaration file inside the package. Read that declaration for the props and
|
|
28
|
+
callbacks. Do not guess a prop from another library. The same index is at `@mechane-ai/elements/catalog.json`.
|
|
29
|
+
|
|
30
|
+
## Set up once
|
|
31
|
+
|
|
32
|
+
- Import `@mechane-ai/elements/styles.css` once at the app entry. Ordinary React apps need no StyleX compiler.
|
|
33
|
+
- Spread `themeProps.light` or `themeProps.dark` from `/theme` onto the document root, so portaled menus and dialogs
|
|
34
|
+
inherit the theme. The app stores the preference.
|
|
35
|
+
- Mount one `Toaster` from `/feedback` at the root when the app reports outcomes with `toast`.
|
|
36
|
+
- Supply the app's own reset and fonts. See [styling](references/styling.md) for layers, tokens and a nonce policy.
|
|
19
37
|
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
## Who owns what
|
|
39
|
+
|
|
40
|
+
Elements owns the interaction, focus, keyboard, announcements and appearance. The app owns routes, data, authorization,
|
|
41
|
+
persistence and every asynchronous operation.
|
|
42
|
+
|
|
43
|
+
- Pass a controlled value with its change callback, or an uncontrolled default. Never both.
|
|
44
|
+
- A change callback receives the value, then the change details. `details.reason` names what happened and
|
|
45
|
+
`details.source` says whether a pointer, the keyboard, an agent or code caused it.
|
|
46
|
+
- Pass pending, failed and ready states in. A click or a resolved request does not mean the operation completed.
|
|
47
|
+
- Import from the family that owns the interaction. Do not import `@ui-sdk/react` beside Elements for the same control.
|
|
48
|
+
- Use a named `variant`, `tone` or `density`. There is no size, padding or radius prop. `xstyle` takes placement only,
|
|
49
|
+
such as width or alignment.
|
|
50
|
+
|
|
51
|
+
## Pick the component
|
|
52
|
+
|
|
53
|
+
| The page needs | Use | Read |
|
|
54
|
+
| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
|
|
55
|
+
| An app frame, a page, sections, a record page | `AppShell`, `PageLayout`, `PageSection`, `RecordPage` | [workspace](references/workspace.md) |
|
|
56
|
+
| Records compared across columns, search, filters | `DataTable` with a `query` | [collections](references/collections.md) |
|
|
57
|
+
| A selected record's fields beside its list | `Inspector`, `Details` | [collections](references/collections.md) |
|
|
58
|
+
| Fields, choices, dates, files, a save | `Field`, the `/forms` controls, `FormActions`, `ConfirmButton` | [forms](references/forms.md) |
|
|
59
|
+
| A trend, comparison, distribution or relationship | One chart from a `/charts/*` entry | [charts](references/charts.md) |
|
|
60
|
+
| A figure an agent or a server writes as JSON | `Figure`, `validateFigureSpec`, `describeFigure` and `chartGuide` from `/charts/figure` | [figures](references/figures.md) |
|
|
61
|
+
| A run, evaluation, service, feature or explainer | A kit from `/kits/training`, `/kits/evaluation`, `/kits/operations`, `/kits/explainers`, `/kits/interpretability` | [kits](references/kits.md) |
|
|
62
|
+
| A first read, a refresh, an empty or failed read | `AsyncRegion`, `LoadingScope`, `EmptyState`, `Notice` | [reports](references/reports.md) |
|
|
63
|
+
| A command menu, a decision, an anchored panel | `Menu`, `AlertDialog`, `Dialog`, `Drawer`, `Popover`, `Tooltip` | the catalog |
|
|
64
|
+
| Route destinations or panels inside one view | `PageNavigation` for links, `Tabs` or `ContentTabs` for panels | [workspace](references/workspace.md) |
|
|
65
|
+
| A transcript, a prompt, tool activity, approvals | `Conversation`, `Message`, `PromptInput`, `Approval` | [conversations](references/conversations.md) |
|
|
66
|
+
| Markdown, source, a diff, a file tree, a log | `/content/markdown`, `/content/code`, `/content/diff`, `/content/tree`, `/content` | the catalog |
|
|
67
|
+
| A model or browser agent that reads and acts | `createAgent` and `registerTools` from `/agent` | [agent access](references/agent.md) |
|
|
68
|
+
|
|
69
|
+
## Start from a recipe
|
|
22
70
|
|
|
23
71
|
- **Searchable collection.** Use local query mode for a complete finite collection. For a paged source, send search and
|
|
24
72
|
filters to the data owner before it takes a page. Keep the query and current page together in route state when users
|
|
25
73
|
need to return to the same results.
|
|
26
74
|
- **Sectioned report.** Mount the shell around the router outlet. Put each heading and its body in a sibling
|
|
27
|
-
`PageSection`. The shell and sections own the sticky geometry.
|
|
28
|
-
|
|
75
|
+
`PageSection`. The shell and sections own the sticky geometry.
|
|
76
|
+
- **Linked figures.** Give each model, run or series one id. Wrap the figures in `ToneScope` and `ChartLink` so a thing
|
|
77
|
+
keeps one hue and inspecting it in one figure marks it in the others.
|
|
78
|
+
- **A chart you cannot name.** Read `chartGuide` from `/charts/figure`, or the chooser in
|
|
79
|
+
[charts](references/charts.md). It lists all 50 registered charts by family, with when to use each one.
|
|
80
|
+
- **Allocation report.** Show how one total divides with a parts strip above one explanatory chart. Give each part one
|
|
81
|
+
tone everywhere.
|
|
29
82
|
- **Tabbed workspace.** Put page-wide navigation and its actions in the page navigation slot. Use links for route
|
|
30
83
|
destinations and tabs for panels within the current view.
|
|
31
84
|
- **Consequential form.** The owner validates and submits the draft. Use the shared confirmation and pending states,
|
|
32
85
|
mark sensitive input at its source, and keep the draft available when the save fails.
|
|
33
86
|
|
|
34
|
-
For a task outside
|
|
35
|
-
|
|
36
|
-
|
|
87
|
+
For a task outside the recipes, search the catalog for a public component and compose it with the layout parts above. In
|
|
88
|
+
a running Elements Storybook, an MCP client can also discover components and examples at `/mcp`.
|
|
89
|
+
|
|
90
|
+
## Before you finish
|
|
91
|
+
|
|
92
|
+
Check the page with the `review-elements` skill: keyboard alone, every read state, a phone width, the dark theme, and
|
|
93
|
+
what an agent sees. After a package upgrade, follow the `upgrade-elements` skill.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Agent access
|
|
2
|
+
|
|
3
|
+
Elements components describe themselves to an agent: a name, a label, their state, their items and the actions a person
|
|
4
|
+
could take. The bridge is optional. Nothing is exposed until the application creates it.
|
|
5
|
+
|
|
6
|
+
## Turn it on
|
|
7
|
+
|
|
8
|
+
Create the bridge in client code at browser startup:
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { createAgent, registerTools } from '@mechane-ai/elements/agent';
|
|
12
|
+
import type { AgentAction } from '@mechane-ai/elements/agent';
|
|
13
|
+
|
|
14
|
+
const allow = (step: AgentAction) =>
|
|
15
|
+
step.confirm === undefined && step.component === 'collection-query' && step.action === 'setQuery';
|
|
16
|
+
|
|
17
|
+
const agent = createAgent({ allow });
|
|
18
|
+
const unregister = registerTools(agent, { allow });
|
|
19
|
+
// Call unregister() when the host ends this integration.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- `agent.snapshot()` lists the mounted components with their state and actions. `agent.query(...)` finds components and
|
|
23
|
+
list items. `agent.act({ steps })` runs steps in order.
|
|
24
|
+
- For the app's own model, pass the definitions in `agentTools` to the model and route each call to the matching method.
|
|
25
|
+
- `registerTools` exposes the same tools to a browser agent through WebMCP. It needs `allow`.
|
|
26
|
+
- `allow` decides each step. Start by allowing the few actions the product needs. A step with `confirm` set is one a
|
|
27
|
+
person must approve, such as Send, Stop or an approval decision.
|
|
28
|
+
|
|
29
|
+
## What an agent can read and do
|
|
30
|
+
|
|
31
|
+
| Component | It reads | It can ask for |
|
|
32
|
+
| -------------------- | ------------------------------------------------ | ---------------------------------------------------- |
|
|
33
|
+
| `collection-query` | The search text and filter choices | `setQuery`, `submitSearch`, `setFilter` |
|
|
34
|
+
| `collection-results` | Every supplied row as a named item, and `status` | `sort`, `select`, `open`, `previousPage`, `nextPage` |
|
|
35
|
+
| `chart` | Each item with exact values, inspected, selected | `inspect`, `select`, `dismiss` |
|
|
36
|
+
| `chart-range` | The selected range | `setRange`, `clear` |
|
|
37
|
+
| `link` | `href` and whether it is current | `follow` |
|
|
38
|
+
| `page-title` | The page's title | Nothing |
|
|
39
|
+
| `page-section` | The section at the reading position | Nothing |
|
|
40
|
+
| `detail-field` | A labeled field of the selected record | Nothing |
|
|
41
|
+
| `form-status` | Pending, error or success, with its message | Nothing |
|
|
42
|
+
| `message` | A message's author, kind and text | Nothing |
|
|
43
|
+
| `viewer` | A code, diff, JSON, log or stack viewer's label | Nothing |
|
|
44
|
+
|
|
45
|
+
Form controls, menus, dialogs, tabs and the other controls appear under their UI SDK names with their own actions. Read
|
|
46
|
+
`agent.snapshot()` in the running app for the exact list.
|
|
47
|
+
|
|
48
|
+
## Rules for the application
|
|
49
|
+
|
|
50
|
+
- An agent's step goes through the same callback as a person's press. `details.source` is `agent` in that callback.
|
|
51
|
+
- A requested change to a controlled value is complete only when the application supplies the new state. After a step,
|
|
52
|
+
read the result again. Wait for `collection-results` to report `status: 'ready'`; a pending read can keep old rows.
|
|
53
|
+
- A refused step explains itself, for example with the columns a table can sort by. Let the agent read the refusal.
|
|
54
|
+
- Advertise an action only when the visible control can perform it. Disable the control and the action together.
|
|
55
|
+
- Keep credentials and private values out of labels, descriptions and results. Set `isSensitive` on `Field.Root`.
|
|
56
|
+
- The bridge is not authorization. The server authorizes every read and mutation.
|
|
57
|
+
- Give every interactive component an accessible name. An agent finds a component by its name and label.
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# Charts
|
|
2
|
+
|
|
3
|
+
Import shared props, formats, tone scope and linking from `@mechane-ai/elements/charts`, and each chart from its family
|
|
4
|
+
entry. The application queries, aggregates, ranks, samples and computes statistics. A chart draws supplied values and
|
|
5
|
+
lets a reader inspect them. To describe a figure as JSON, read [figures](figures.md). For ready-made domain pages, read
|
|
6
|
+
[kits](kits.md).
|
|
7
|
+
|
|
8
|
+
## How every chart works
|
|
9
|
+
|
|
10
|
+
- One kernel draws all of them, so axes, ticks, marks, readout and keyboard cursor behave alike.
|
|
11
|
+
- Every chart takes the same figure props: `title`, `description`, `locale`, `source`, `coverage`, `transforms`,
|
|
12
|
+
`status`, `emptyLabel`, `report` and `actions`.
|
|
13
|
+
- A number or an instant is written from a declared format and the figure's `locale`. A format is data, not a function.
|
|
14
|
+
- Each visual channel has one meaning: hue names a thing, lightness is a magnitude, two hues around a neutral middle are
|
|
15
|
+
a signed value, a dashed stroke is modelled, a pale band is uncertainty, a hollow mark is missing, gray is context.
|
|
16
|
+
- Every figure has the same states: loading, empty, invalid, partial and ready.
|
|
17
|
+
|
|
18
|
+
## Choose the chart
|
|
19
|
+
|
|
20
|
+
Pick by the question. The tables are the library's `chartGuide`, written out: one entry per registered chart, 50 in all,
|
|
21
|
+
grouped by family. `chartGuide` is exported from `@mechane-ai/elements/charts/figure`, so you can read the same guidance
|
|
22
|
+
at run time. Each entry has `chart`, `family`, `question`, `use`, `avoid` and `example`, a small valid figure spec to
|
|
23
|
+
start from.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { chartGuide } from '@mechane-ai/elements/charts/figure';
|
|
27
|
+
|
|
28
|
+
const entry = chartGuide.find((item) => item.chart === 'DotPlot');
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`ColorLegend` (`/charts/matrix`), the table cells (`/charts/cells`: `BarCell`, `HeatCell`, `ChangeCell`, `IntervalCell`
|
|
32
|
+
and `SparkCell`), the placeholders and the kits are not registered charts, so the guide does not list them. Use a bar,
|
|
33
|
+
heat, change, interval or spark cell for a graphic inside a table column. Use a table when exact comparison matters more
|
|
34
|
+
than shape.
|
|
35
|
+
|
|
36
|
+
### `trend`
|
|
37
|
+
|
|
38
|
+
Import from `@mechane-ai/elements/charts/trend`.
|
|
39
|
+
|
|
40
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
41
|
+
| -------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `CurveChart` | How did a metric change over training steps or another ordered variable? | Use it for loss, accuracy or any measure over steps, layers or doses, on linear or log axes, with bands for spread across seeds. | Use LineChart when the ordered variable is a timestamp, and RunsChart when there are dozens of runs to show as context. |
|
|
43
|
+
| `RunsChart` | How does one run compare with the whole sweep it belongs to? | Use it for many training runs at once: every run stays gray context and only the runs you name are drawn in color. | Use CurveChart for a handful of series that each deserve a color and a legend entry. |
|
|
44
|
+
| `SlopeChart` | How did each item move between two to six conditions? | Use it to compare before and after, or a few checkpoints, where the direction of each change matters more than the path. | Use DumbbellPlot when there are many rows and exactly two conditions, and CurveChart when the conditions are many ordered steps. |
|
|
45
|
+
| `BumpChart` | How did the ranking of items change across stages? | Use it when the order matters more than the values: a leaderboard over releases, or model rank per evaluation round. | Use SlopeChart or CurveChart when the size of the gaps between items matters. |
|
|
46
|
+
| `HorizonChart` | Which of many series run above or below normal, and when? | Use it for dozens of aligned series in little height, such as the error rate of every service over a day. | Use LineChart or SmallMultiples when there are only a few series and readers need exact levels. |
|
|
47
|
+
|
|
48
|
+
### `comparison`
|
|
49
|
+
|
|
50
|
+
Import from `@mechane-ai/elements/charts/comparison`.
|
|
51
|
+
|
|
52
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
53
|
+
| -------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| `DotPlot` | How do a few models compare on each of several measures? | Use it to compare values across categories without bars, when the axis need not start at zero and intervals matter. | Use BarChart when the amount itself, measured from zero, is the point. |
|
|
55
|
+
| `DumbbellPlot` | How much did each row change between two measurements? | Use it for many rows with exactly two values each, such as scores before and after fine-tuning. | Use SlopeChart for few rows or more than two conditions, and BridgeChart for how parts add up to a total change. |
|
|
56
|
+
| `BulletBar` | Is each measure meeting its target? | Use it for a few key measures held against targets and qualitative bands, such as latency against its objective. | Use BarChart when there are no targets, and a table when readers need many exact values. |
|
|
57
|
+
|
|
58
|
+
### `cartesian`
|
|
59
|
+
|
|
60
|
+
Import from `@mechane-ai/elements/charts/cartesian`.
|
|
61
|
+
|
|
62
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
63
|
+
| ---------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `BarChart` | How large is each amount, by category and series? | Use it for amounts measured from zero across a few categories, grouped or stacked by series. | Use DotPlot when the values do not start at zero, and LineChart when the categories are instants. |
|
|
65
|
+
| `BridgeChart` | Which changes add up to the difference between two totals? | Use it to explain a change from one total to another as a sequence of signed parts, such as cost by cause. | Use BarChart when the parts are independent amounts, not steps from one total to the next. |
|
|
66
|
+
| `BreakdownBar` | How does one total split into parts? | Use it for a single total and a few named parts, such as where the time of a request went. | Use Treemap for many parts, and BarChart to compare several totals. |
|
|
67
|
+
| `ScatterPlot` | How do two measures of the same records relate? | Use it for up to a thousand records with two measures each, such as cost and accuracy per model. | Use EmbeddingMap or DensityMap for many thousands of points, and ScatterMatrix for more than two measures. |
|
|
68
|
+
| `LineChart` | How did a measure change over time? | Use it for a few series over timestamps, such as latency per minute or requests per hour. | Use CurveChart when the ordered variable is not time, and HorizonChart for dozens of series. |
|
|
69
|
+
| `AreaChart` | How did a total and its parts change over time? | Use it stacked for parts that add up to a meaningful total over time, such as requests by region. | Use LineChart when the series do not add up, or when readers compare series that are not at the bottom. |
|
|
70
|
+
| `SmallMultiples` | How do several related measures move together over the same time? | Use it for a few measures with different units on one shared time axis, inspected together. | Use LineChart when the series share one unit and belong on one plot. |
|
|
71
|
+
| `Sparkline` | Which way is one measure trending, at a glance? | Use it inline beside a number or in a dense summary, where a full chart would be too much. | Use LineChart when readers need axes, exact values or several series. |
|
|
72
|
+
|
|
73
|
+
### `distribution`
|
|
74
|
+
|
|
75
|
+
Import from `@mechane-ai/elements/charts/distribution`.
|
|
76
|
+
|
|
77
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
78
|
+
| -------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| `Histogram` | How are the values of one measure distributed? | Use it for the shape of one distribution from prepared bins, such as response lengths or latencies. | Use ECDF to read percentiles exactly, and BoxPlot or ViolinPlot to compare several groups. |
|
|
80
|
+
| `ECDF` | What share of values falls below a given level? | Use it to read percentiles and compare tails exactly, such as the share of requests under a latency objective. | Use Histogram when the shape of the distribution matters more than its percentiles. |
|
|
81
|
+
| `IntervalPlot` | What is each estimate, and how uncertain is it? | Use it for estimates with confidence or credible intervals, such as an effect size per benchmark. | Use DotPlot to compare several series per row, and BoxPlot to show the spread of raw values. |
|
|
82
|
+
| `RankedBars` | Which items rank highest on one measure? | Use it for a sorted top list, such as the features or prompts with the largest effect. | Use BarChart when the categories have a natural order, and DotPlot when values do not start at zero. |
|
|
83
|
+
| `BoxPlot` | How do the distributions of several groups compare? | Use it for prepared quartiles of a handful of groups, such as latency per region, with outliers marked. | Use ViolinPlot when the shape matters, and StripPlot when there are few enough values to show each. |
|
|
84
|
+
| `ViolinPlot` | How does the shape of a distribution differ between groups? | Use it for prepared densities of a few groups when bimodality or skew matters, such as reward per policy. | Use BoxPlot when quartiles are enough, and Ridgeline for many groups in order. |
|
|
85
|
+
| `StripPlot` | Where does every single value of each group fall? | Use it when there are few enough values to show each one, such as the score of every seed. | Use BoxPlot or ViolinPlot when there are hundreds of values per group. |
|
|
86
|
+
| `Ridgeline` | How does a distribution shift across many ordered groups? | Use it for prepared densities of many groups in order, such as activation values per layer. | Use ViolinPlot for a few unordered groups, and Histogram for one distribution. |
|
|
87
|
+
|
|
88
|
+
### `matrix`
|
|
89
|
+
|
|
90
|
+
Import from `@mechane-ai/elements/charts/matrix`.
|
|
91
|
+
|
|
92
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
93
|
+
| ------------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
94
|
+
| `Matrix` | What is the value for every pair of two categories? | Use it for a measured value per row and column, such as accuracy per model and benchmark, with missing cells marked. | Use ConfusionMatrix, CorrelationMatrix or AttentionMatrix for those specific matrices, and DotPlot for few rows. |
|
|
95
|
+
| `TokenHeatmap` | Which tokens of a text carry the most of a score? | Use it to shade a passage by a per-token value, such as a feature’s activation or a token’s loss. | Use TokenExamples for several passages, and TokenPredictions for the next-token distribution. |
|
|
96
|
+
| `ConfusionMatrix` | Which classes does a classifier confuse with which? | Use it for counts of true against predicted classes, raw or normalized per true class. | Use Matrix for any other value per pair, and BarChart for per-class accuracy alone. |
|
|
97
|
+
| `CorrelationMatrix` | Which measures move together? | Use it for prepared correlation coefficients between a few measures, such as benchmark scores across models. | Use ScatterMatrix to see the points behind each coefficient. |
|
|
98
|
+
| `AttentionMatrix` | Which earlier tokens does each token attend to? | Use it for one head’s attention weights over a short sequence, with the causal mask shown. | Use TokenLinks to read the strongest links as lines between two rows of the text. |
|
|
99
|
+
| `CalendarHeatmap` | How does a daily measure vary by week and weekday? | Use it for one value per day over weeks or months, such as daily evaluation runs or incidents. | Use LineChart when the trend matters more than the weekly pattern. |
|
|
100
|
+
|
|
101
|
+
### `graph`
|
|
102
|
+
|
|
103
|
+
Import from `@mechane-ai/elements/charts/graph`.
|
|
104
|
+
|
|
105
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
106
|
+
| ------------------ | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
107
|
+
| `RelationGraph` | How are a few named things connected? | Use it for a small graph whose positions the application lays out, such as services and their calls. | Use FlowDiagram when links carry amounts, and TreeDiagram for a strict hierarchy. |
|
|
108
|
+
| `FlowDiagram` | Where does a quantity go between stages? | Use it for amounts flowing between stages, such as requests from source through filter to outcome. | Use BridgeChart for changes to one total, and RelationGraph when links carry no amount. |
|
|
109
|
+
| `AttributionGraph` | Which features carry a model’s answer from the prompt to the output? | Use it for an attribution graph: tokens, features by layer and the output, with signed edge weights. | Use FlowDiagram for amounts that are conserved between stages, and TokenLinks for token-to-token weights. |
|
|
110
|
+
| `TreeDiagram` | How is a hierarchy structured? | Use it to show parent and child relations, such as a run’s spans or an agent’s plan, when the structure is the point. | Use Treemap or Icicle when each node carries an amount readers should compare. |
|
|
111
|
+
|
|
112
|
+
### `hierarchy`
|
|
113
|
+
|
|
114
|
+
Import from `@mechane-ai/elements/charts/hierarchy`.
|
|
115
|
+
|
|
116
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
117
|
+
| --------- | --------------------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
|
|
118
|
+
| `Treemap` | Which parts make up most of a total? | Use it for many parts of one total where the large parts matter, such as spend by project. | Use BreakdownBar for a few parts, Icicle for nested levels and RankedBars to compare parts exactly. |
|
|
119
|
+
| `Icicle` | How does a total split through nested levels? | Use it for a hierarchy whose nodes carry amounts, such as time spent per span of a trace. | Use Treemap for one level of many parts, and TreeDiagram when there are no amounts. |
|
|
120
|
+
|
|
121
|
+
### `timeline`
|
|
122
|
+
|
|
123
|
+
Import from `@mechane-ai/elements/charts/timeline`.
|
|
124
|
+
|
|
125
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
126
|
+
| ------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
127
|
+
| `Waterfall` | When did each step of a request or run start and end? | Use it for the recorded timing of many steps on one scale, with exact timing stated for each row. | Use EventStrip for events in a few lanes over a long window, and BreakdownBar for totals per step. |
|
|
128
|
+
| `EventStrip` | What happened when, across a few kinds of events? | Use it for deploys, incidents, runs and alerts over hours or days, where overlaps between lanes matter. | Use Waterfall for the steps of one request, and LineChart for a measured value over time. |
|
|
129
|
+
|
|
130
|
+
### `relationship`
|
|
131
|
+
|
|
132
|
+
Import from `@mechane-ai/elements/charts/relationship`.
|
|
133
|
+
|
|
134
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
135
|
+
| --------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
|
136
|
+
| `ContourPlot` | What does a value look like over two continuous inputs? | Use it for a prepared grid over two inputs, such as loss over two hyperparameters, with an optimizer’s path. | Use DensityMap for counts of points, and Matrix for a value per pair of categories. |
|
|
137
|
+
| `ScatterMatrix` | How do several measures relate to each other, pair by pair? | Use it for up to six measures of a few hundred records, such as cost, latency and accuracy per model. | Use ScatterPlot for one pair, ParallelCoordinates for many measures, and CorrelationMatrix for coefficients alone. |
|
|
138
|
+
| `ParallelCoordinates` | Which records do well on many measures at once? | Use it to filter records across many measures, such as hyperparameter trials by their settings and score. | Use ScatterMatrix to see pairwise relations, and a table for exact values. |
|
|
139
|
+
| `EmbeddingMap` | How do many items cluster in a learned embedding space? | Use it for thousands to a million projected points with groups and landmarks, drawn on canvas or WebGL. | Use ScatterPlot when every point needs to be inspected by name, and DensityMap when only density matters. |
|
|
140
|
+
| `DensityMap` | Where are points concentrated over two measures? | Use it for prepared two-dimensional counts of very many points, such as prompt length against latency. | Use ScatterPlot when there are few enough points to show each, and ContourPlot for a measured surface. |
|
|
141
|
+
|
|
142
|
+
### `text`
|
|
143
|
+
|
|
144
|
+
Import from `@mechane-ai/elements/charts/text`.
|
|
145
|
+
|
|
146
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
147
|
+
| ------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
148
|
+
| `TokenExamples` | On which passages, and which tokens, does a feature fire? | Use it for the top activating examples of a feature, each passage shaded by activation around its peak. | Use TokenHeatmap for one passage, and TokenGrid to compare several values per token. |
|
|
149
|
+
| `TokenPredictions` | Which tokens does the model expect next, and how did that change? | Use it for the top next-token probabilities at one position, against a baseline such as before an intervention. | Use RankedBars for ranked values that are not token probabilities. |
|
|
150
|
+
| `TokenGrid` | How does a per-token value change across layers or conditions? | Use it for one value per token and row, such as a logit-lens probability per layer. | Use TokenHeatmap for a single row, and Matrix when the columns are not tokens. |
|
|
151
|
+
| `TokenLinks` | Which tokens most influence which later tokens? | Use it for the strongest token-to-token weights, such as attention or attribution, drawn as lines between two rows of the text. | Use AttentionMatrix to see every weight of a head. |
|
|
152
|
+
|
|
153
|
+
### `image`
|
|
154
|
+
|
|
155
|
+
Import from `@mechane-ai/elements/charts/image`.
|
|
156
|
+
|
|
157
|
+
| Chart | Shows | Use it when | Another chart is better when |
|
|
158
|
+
| -------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
159
|
+
| `ImageGrid` | What do a set of images look like, with a value for each? | Use it for a gallery of inputs or samples with a score each, such as a classifier’s most confident errors. | Use ImageAtlas when the images sit at positions in a two-dimensional layout. |
|
|
160
|
+
| `AttributionOverlay` | Which parts of an image drove the model’s output? | Use it for a saliency or attribution grid laid over one image, with an adjustable opacity. | Use ImageGrid to compare many images. |
|
|
161
|
+
| `ImageAtlas` | How do images arrange over a two-dimensional layout? | Use it for images placed on a grid by a projection or two factors, such as a feature visualization atlas. | Use ImageGrid for a plain gallery, and EmbeddingMap for many points without pictures. |
|
|
162
|
+
|
|
163
|
+
## Shared props
|
|
164
|
+
|
|
165
|
+
Every chart except `Sparkline`, `Waterfall`, `ColorLegend` and the cells takes `FigureProps`. `Waterfall` takes `title`,
|
|
166
|
+
`report`, `locale` and `emptyLabel`.
|
|
167
|
+
|
|
168
|
+
| Prop | Meaning |
|
|
169
|
+
| ------------- | ----------------------------------------------------------------------------------------- |
|
|
170
|
+
| `title` | Required. What was measured. |
|
|
171
|
+
| `description` | A string. One or two sentences: the period or sample and how to read it. |
|
|
172
|
+
| `locale` | Required. The locale of every number and date, such as `"en-US"`. |
|
|
173
|
+
| `source` | Where the data came from. It goes in the footnote. |
|
|
174
|
+
| `coverage` | `{ shown, total, unit }` when the figure draws part of the data. It is stated by title. |
|
|
175
|
+
| `transforms` | What you did to the data, in words: `["Smoothed over 5 steps"]`. It goes in the footnote. |
|
|
176
|
+
| `status` | `'ready'`, `'loading'` or `'refreshing'`. Loading holds the final geometry. |
|
|
177
|
+
| `emptyLabel` | The sentence shown when there is nothing to draw. |
|
|
178
|
+
| `report` | Sets the figure in a bordered report with a summary. See "Compose a report". |
|
|
179
|
+
| `actions` | Controls beside the title. A React slot, so a JSON spec cannot carry it. |
|
|
180
|
+
| `height` | `'compact'` (160), `'regular'` (260) or `'tall'` (380). Never a number. |
|
|
181
|
+
|
|
182
|
+
Application state arrives as a value with a change callback that receives the change details:
|
|
183
|
+
|
|
184
|
+
- `selected` with `onSelectedChange(id, details)` for a record the reader pressed or chose with Enter.
|
|
185
|
+
- `range` with `onRangeChange(range, details)` for a drawn range. `LineChart` and `AreaChart` also need `rangeStep`, a
|
|
186
|
+
number in the timestamp unit. `ScatterPlot` needs `rangeStep={{ x, y }}`.
|
|
187
|
+
- `highlighted` for emphasis from outside, such as a table row. It does not change selection. `CurveChart`, `DotPlot`
|
|
188
|
+
and `BarChart` take the id of one series, or `null` for none. `RunsChart` takes `featured`, a required list of run ids
|
|
189
|
+
drawn in their hue.
|
|
190
|
+
- `inspected` with `onInspectedChange` on `ChartLink`.
|
|
191
|
+
|
|
192
|
+
## Declare formats
|
|
193
|
+
|
|
194
|
+
A figure never takes `formatValue`, `formatX` or a similar function prop.
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import { CurveChart } from '@mechane-ai/elements/charts/trend';
|
|
198
|
+
|
|
199
|
+
<CurveChart
|
|
200
|
+
title="Validation loss"
|
|
201
|
+
description="Synthetic runs. Bands span three seeds."
|
|
202
|
+
locale="en-US"
|
|
203
|
+
series={series}
|
|
204
|
+
x={{ label: 'Training step', scale: 'log', format: { maximumFractionDigits: 0 } }}
|
|
205
|
+
y={{ label: 'Loss (nats)', domain: [1, 5], format: { maximumFractionDigits: 2 } }}
|
|
206
|
+
source="Synthetic sweep"
|
|
207
|
+
transforms={['Mean of three seeds']}
|
|
208
|
+
/>;
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
- A measured axis is a `PlotAxis`: `{ label, domain?, scale?, format, tickFormat? }`. Put the unit in `label`. Leave
|
|
212
|
+
`domain` out to fit round bounds. `scale` is `'linear'`, `'log'` or `'symlog'`.
|
|
213
|
+
- A lone measure is `valueFormat` with an optional `tickFormat`. A time axis uses `timeFormat`.
|
|
214
|
+
- A `ValueFormat` is `Intl.NumberFormat` options. Ticks use its compact form unless you set `tickFormat`.
|
|
215
|
+
- A `TimeFormat` is `Intl.DateTimeFormat` options that name a `timeZone`. A function is allowed only where no option can
|
|
216
|
+
write the text, and a JSON figure spec cannot carry one.
|
|
217
|
+
- Timestamps reach `formatTime` in milliseconds. Set `timestampUnit` to `'seconds'` or `'milliseconds'`.
|
|
218
|
+
|
|
219
|
+
## Newer props
|
|
220
|
+
|
|
221
|
+
- `valueLabel` is the value axis title on `LineChart`, `AreaChart`, each `SmallMultiples` panel, `BarChart` and
|
|
222
|
+
`BridgeChart`.
|
|
223
|
+
- `Sparkline` takes `layout` of `'inline'` or `'figure'`. `SparkCell` takes `label` of `'last'` or `'peak'`.
|
|
224
|
+
- `CurveChart` takes `markers`, a list of `{ x, label }`. `SmallMultiples` panels take `bands`.
|
|
225
|
+
- `EventStrip` takes `gutterWidth`. `eventStripGutter(labels)` returns one wide enough for every lane label, so stacked
|
|
226
|
+
strips line up.
|
|
227
|
+
- `Waterfall` draws in the shared frame and takes `description`, `actions`, `source` and `transforms`.
|
|
228
|
+
- `IntervalPlot` and `RankedBars` take `height`, the room per row. They write no value beside a row. The readout and the
|
|
229
|
+
exact-value table carry the values.
|
|
230
|
+
- `Matrix`, `AttentionMatrix`, `ConfusionMatrix` and `CorrelationMatrix` take `cellValues` of `'shown'` or `'hidden'`.
|
|
231
|
+
- Attention: the source is the token attended to and the destination is the token that attends. `AttentionMatrix` rows
|
|
232
|
+
are `destinations`, columns are `sources`, and `weights` has one line per destination. A `TokenLinks` link is
|
|
233
|
+
`{ sourceId, destinationId, weight }`, and `direction` is `'source-to-destination'`.
|
|
234
|
+
|
|
235
|
+
## Supply honest data
|
|
236
|
+
|
|
237
|
+
- A missing value is `null`. It draws a hollow mark or a gap and reads "Unavailable". Never write it as zero.
|
|
238
|
+
- Bars, histograms and other length marks start at zero. Position marks such as dots need not.
|
|
239
|
+
- A log axis needs positive values and says so in its title. A symlog axis holds zero and negative values.
|
|
240
|
+
- A chart refuses invalid input with a stated reason and never repairs, clamps, reorders or drops a record.
|
|
241
|
+
- A chart takes prepared values. Compute quartiles, bins, densities, fits, smoothing and ranks first, with
|
|
242
|
+
`@mechane-ai/elements/charts/transforms`, and name each step in `transforms`.
|
|
243
|
+
- A figure that draws a sample or a window sets `coverage`, so the reader sees how much is shown.
|
|
244
|
+
- Grid data counts from the lowest value. `DensityMap` takes a `histogram` with one count per cell, row by row. Row 0
|
|
245
|
+
holds the lowest `y` and column 0 the lowest `x`, so rows count up from the bottom. The `bin2d` transform returns this
|
|
246
|
+
order.
|
|
247
|
+
- The title and description say what was measured, and for which period or sample.
|
|
248
|
+
|
|
249
|
+
## Limits
|
|
250
|
+
|
|
251
|
+
Most charts export a limits object and refuse more with a message that names the limit. Choose a window or an aggregate
|
|
252
|
+
first. A selection of the limits:
|
|
253
|
+
|
|
254
|
+
| Chart | Limits |
|
|
255
|
+
| ------------------ | --------------------------------------------------------- |
|
|
256
|
+
| `LineChart` etc. | `timeSeriesLimits`: 12 series, 2000 points, 200 markers |
|
|
257
|
+
| `BarChart` etc. | 200 items and 12 series. The message names the limit. |
|
|
258
|
+
| `ScatterPlot` | `scatterLimits`: 1000 points |
|
|
259
|
+
| `Matrix` | `matrixLimits`: 4096 cells |
|
|
260
|
+
| `TokenHeatmap` | `tokenHeatmapLimits`: 2048 tokens |
|
|
261
|
+
| `RelationGraph` | `relationGraphLimits`: 256 nodes, 1024 edges |
|
|
262
|
+
| `FlowDiagram` | `flowLimits`: 64 nodes, 256 links |
|
|
263
|
+
| `CurveChart` | `curveLimits`: 12 series, 2000 points per series |
|
|
264
|
+
| `EmbeddingMap` | `embeddingLimits`: 100,000 canvas points, 1,000,000 WebGL |
|
|
265
|
+
| `EventStrip` | `eventStripLimits`: 12 lanes, 1000 events |
|
|
266
|
+
| `AttributionGraph` | `attributionLimits`: 400 nodes, 2000 edges, 40 layers |
|
|
267
|
+
| `TreeDiagram` | `treeLimits`: 300 nodes, depth 12 |
|
|
268
|
+
|
|
269
|
+
The others follow the same pattern, such as `boxLimits` and `runsLimits`. Read the declaration file of the chart you
|
|
270
|
+
use. `BarChart`, `BridgeChart`, `BreakdownBar` and `Treemap` share `categoricalLimits` from `/charts`, and `Histogram`,
|
|
271
|
+
`ECDF`, `IntervalPlot` and `RankedBars` share `distributionLimits` from `/charts/distribution`. `densityLimits` from
|
|
272
|
+
`/charts/relationship` bounds `DensityMap`, and `densityLimits` from `/charts/transforms` bounds a density estimate.
|
|
273
|
+
|
|
274
|
+
Marks a reader inspects one by one draw as SVG. `EmbeddingMap` draws on canvas up to 100,000 points and with WebGL up to
|
|
275
|
+
1,000,000, and `DensityMap` draws on canvas. A canvas or WebGL plot keeps the same inspection, selection, readout and
|
|
276
|
+
text alternative. The WebGL figure was measured in a headless software renderer, not on a GPU.
|
|
277
|
+
|
|
278
|
+
## Selection, inspection and ranges
|
|
279
|
+
|
|
280
|
+
Inspection is built in. A plot is one Tab stop. Hover or the arrow keys inspect, Home and End reach the ends, a press or
|
|
281
|
+
Enter selects, a drag draws a range and Escape closes the readout. Pan and zoom are opt-in, as `isExplorable` on
|
|
282
|
+
`EmbeddingMap`, and a plain scroll always scrolls the page. Do not add your own tooltip or key handler.
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
<RankedBars
|
|
286
|
+
title="Top error sources"
|
|
287
|
+
locale="en-US"
|
|
288
|
+
items={items}
|
|
289
|
+
value={{ label: 'Share of errors', format: { style: 'percent' } }}
|
|
290
|
+
selected={selectedId}
|
|
291
|
+
onSelectedChange={(id) => setSelectedId(id)}
|
|
292
|
+
/>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The app owns the linked inspector, route or filter. Leave `onSelectedChange` out for a read-only figure. `Waterfall`
|
|
296
|
+
requires it.
|
|
297
|
+
|
|
298
|
+
## Link figures and keep one hue per thing
|
|
299
|
+
|
|
300
|
+
Give a thing one id in every figure. `ToneScope` gives each id one hue. `ChartLink` shares one inspected id between the
|
|
301
|
+
figures inside it: pointing at a record in one figure marks the record with the same id in the others.
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
import { ChartLink, ToneScope } from '@mechane-ai/elements/charts';
|
|
305
|
+
import { DotPlot } from '@mechane-ai/elements/charts/comparison';
|
|
306
|
+
import { CurveChart } from '@mechane-ai/elements/charts/trend';
|
|
307
|
+
|
|
308
|
+
<ToneScope ids={['small', 'base']}>
|
|
309
|
+
<ChartLink>
|
|
310
|
+
<CurveChart title="Loss" locale="en-US" series={curves} x={step} y={loss} />
|
|
311
|
+
<DotPlot title="Score by task" locale="en-US" rows={tasks} series={scores} value={score} />
|
|
312
|
+
</ChartLink>
|
|
313
|
+
</ToneScope>;
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
- A record's own `tone` wins over the scope. Pin a tone when color carries identity across filters.
|
|
317
|
+
- `ChartGrid` is a `ChartLink` and a `ToneScope` laid out as panels with one title. It takes `ids` and `tones` for the
|
|
318
|
+
scope and `minPanelWidth` for the panels.
|
|
319
|
+
- Hovering a row in one figure highlights the same id in the others. `CurveChart` and `DotPlot` also draw the series
|
|
320
|
+
with that id at full strength and fade the rest. Their `highlighted` prop overrides the link.
|
|
321
|
+
- `useScopedTone(id)` returns the hue the scope gives an id, or `undefined` outside a scope, so a sentence or a diagram
|
|
322
|
+
matches its chart. `useChartLinkControl()` returns `{ inspected, inspect }`, or `undefined` outside a link. Call
|
|
323
|
+
`inspect(id, { reason, event })` from prose to point every linked figure at an id.
|
|
324
|
+
- `CurveChart` takes `labels`: `'legend'` (the default), `'inline'` to write each name at the end of its line when there
|
|
325
|
+
is room, or `'none'` when a legend beside a grid already names the series.
|
|
326
|
+
- These charts read the link: `CurveChart`, `RunsChart`, `SlopeChart`, `BumpChart`, `HorizonChart`, `DotPlot`,
|
|
327
|
+
`DumbbellPlot`, `BulletBar`, `IntervalPlot`, `RankedBars`, `BoxPlot`, `ViolinPlot`, `StripPlot`, `Ridgeline`,
|
|
328
|
+
`ScatterMatrix`, `ParallelCoordinates`, `EmbeddingMap`, `EventStrip`, `Icicle`, `AttributionGraph` and `TreeDiagram`.
|
|
329
|
+
|
|
330
|
+
## States
|
|
331
|
+
|
|
332
|
+
Every figure handles the same states:
|
|
333
|
+
|
|
334
|
+
- `status="loading"` shows the final geometry before the first read. Keep it inside an `AsyncRegion`.
|
|
335
|
+
- `status="refreshing"` keeps the drawn data while a newer read is under way.
|
|
336
|
+
- Empty input shows `emptyLabel`. Invalid input shows why it cannot be drawn.
|
|
337
|
+
- A figure that draws part of its data states how much beside its title. Set `coverage`.
|
|
338
|
+
|
|
339
|
+
`LineChart`, `AreaChart`, `SmallMultiples` and `BarChart` also have placeholders: `TimeSeriesChartPlaceholder`,
|
|
340
|
+
`SmallMultiplesPlaceholder` and `BarChartPlaceholder`. Use the same title, report and height as the loaded chart.
|
|
341
|
+
|
|
342
|
+
## Compose a report
|
|
343
|
+
|
|
344
|
+
Pass `report` when the chart is a self-contained analytical report with a caption, a period summary and the plot. Use
|
|
345
|
+
`report.summary` for mixed metrics or `report.seriesValues` for one value per series. Put scoped controls in
|
|
346
|
+
`report.actions` with `density="compact"`. Inside a region that already groups its content, use the chart without
|
|
347
|
+
`report`.
|
|
348
|
+
|
|
349
|
+
## Build a chart the library lacks
|
|
350
|
+
|
|
351
|
+
When no chart answers the question, build one from the kernel in `@mechane-ai/elements/charts/plot` so it shares the
|
|
352
|
+
axes, marks, readout, keyboard cursor, states and tones of the others. Do not draw your own scale, axis or SVG mark.
|
|
353
|
+
|
|
354
|
+
- Lay out with `numericPlot`, `categoryPlot` or `timePlot`, and draw with `PlotSurface`, `PlotAxes`, `PlotClip` and the
|
|
355
|
+
marks: `LineMark`, `AreaMark`, `BandMark`, `DotMark`, `BarMark`, `RuleMark`, `IntervalMark`, `LabelMark`,
|
|
356
|
+
`SymbolMark`, `RingMark`, `LinkMark`, `ConnectorMark` and `GuideMark`.
|
|
357
|
+
- Write ticks with `axisTicks` (or `timeAxisTicks` for time) and `tickTexts`. Tick text gains precision until neighbours
|
|
358
|
+
differ, an axis longer than 120 px shows at least three ticks (`ticksMinimum`), and an axis that draws its title drops
|
|
359
|
+
a `style: 'unit'` from its ticks. Place labels with `freeLabelSpot` and `labelBox` so they do not collide.
|
|
360
|
+
- Give `FigureFrame` a `seriesLegend` for a legend that names things, drawn above the plot, and a `scaleLegend` for a
|
|
361
|
+
color or size scale, drawn below it.
|
|
362
|
+
- Wrap the plot in `Chart` for inspection, the keyboard cursor and selection. Add `ChartCursor`, `ChartInspection` or
|
|
363
|
+
`ChartReadout`, and `ChartData` for the exact-value table.
|
|
364
|
+
- Return `FigureLoading`, `FigureEmpty` and `FigureInvalid` for the shared states, and `FigureFrame` around the plot.
|
|
365
|
+
- Take `FigureProps` and the format types from `@mechane-ai/elements/charts`. Write numbers with `formatValue`, instants
|
|
366
|
+
with `formatTime` and hues with `useTones()`. Spread `useLinkedInspection()` into `Chart` when item ids mean the same
|
|
367
|
+
thing in other charts.
|
|
368
|
+
- Refuse input the chart cannot draw with a reason. Do not repair it.
|
|
369
|
+
|
|
370
|
+
## Do not
|
|
371
|
+
|
|
372
|
+
- Do not pass a formatter function such as `formatValue`, `formatX` or `formatTick`. Declare a format.
|
|
373
|
+
- Do not hard-code a color. Use a `tone`, a `ToneScope` and the library's tokens.
|
|
374
|
+
- Do not compute a statistic inside a chart or in its props. Use `transforms` and name the step.
|
|
375
|
+
- Do not draw two value scales on one plot. Use `SmallMultiples` or two figures.
|
|
376
|
+
- Do not start a bar, histogram or area at a value other than zero.
|
|
377
|
+
- Do not use a log axis for zero or negative values. Use `scale: 'symlog'`.
|
|
378
|
+
- Do not fill a gap to make a line continuous, or write a missing value as zero.
|
|
379
|
+
- Do not use `selectedId`, `onSelect` or a `selection` object. They were removed in 0.47.
|
|
380
|
+
- Do not pass a pixel `height`. Use `'compact'`, `'regular'` or `'tall'`. `RelationGraph` `width` and `height` stay
|
|
381
|
+
numbers: they are the extent of your node positions.
|
|
382
|
+
- Do not omit `locale`. A server and a browser must render the same text.
|
|
383
|
+
- Do not draw SVG marks yourself in a page. Build the chart from the kernel in `@mechane-ai/elements/charts/plot`, or
|
|
384
|
+
add one to the library through the `extend-elements` skill.
|