@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
|
@@ -0,0 +1,3404 @@
|
|
|
1
|
+
import { d as e, f as t, l as n, n as r, p as i, r as a, s as o, t as s } from "../time-series-IB3CB93O.js";
|
|
2
|
+
import { a as c, r as l, t as u } from "../dumbbell-plot-B2ZTgQaI.js";
|
|
3
|
+
import { a as d, d as f, f as p, l as ee, r as te, s as ne, t as re, u as ie } from "../violin-plot-BhPHKXsN.js";
|
|
4
|
+
import { a as ae, r as oe, s as se, t as ce } from "../tree-diagram-DsckNKaW.js";
|
|
5
|
+
import { n as le, t as ue } from "../treemap-9_DpLCW9.js";
|
|
6
|
+
import { a as de, r as fe, t as pe } from "../image-grid-CVA4SOy_.js";
|
|
7
|
+
import { c as me, i as he, o as m, r as ge, t as _e, u as ve } from "../token-heatmap-C00DnoNO.js";
|
|
8
|
+
import { a as ye, l as be, r as xe, s as Se, t as Ce } from "../embedding-map-CGM_k6lC.js";
|
|
9
|
+
import { a as we, c as Te, r as h, t as Ee } from "../token-predictions-Cxx29iDr.js";
|
|
10
|
+
import { n as De, t as Oe } from "../waterfall-CGksuTy5.js";
|
|
11
|
+
import { a as ke, l as Ae, r as je, s as Me, t as Ne } from "../slope-chart-DT22h_ym.js";
|
|
12
|
+
import { m as g } from "../values-963L6n1m.js";
|
|
13
|
+
import { a as _, r as v } from "../figure-frame-wRkIEAwe.js";
|
|
14
|
+
import { createElement as y } from "react";
|
|
15
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
16
|
+
import { formatNumber as Pe } from "@ui-sdk/core/number";
|
|
17
|
+
import { dateFormatter as Fe } from "@ui-sdk/core/date";
|
|
18
|
+
// packages/charts/src/spec/figure-registry.tsx
|
|
19
|
+
function Ie() {}
|
|
20
|
+
function Le(e) {
|
|
21
|
+
let { onSelectedChange: t = Ie, ...n } = e;
|
|
22
|
+
return /* @__PURE__ */ b(Oe, {
|
|
23
|
+
...n,
|
|
24
|
+
onSelectedChange: t
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
var x = {
|
|
28
|
+
locale: "string",
|
|
29
|
+
title: "string"
|
|
30
|
+
}, S = {
|
|
31
|
+
BarChart: {
|
|
32
|
+
chart: "BarChart",
|
|
33
|
+
component: i,
|
|
34
|
+
family: "cartesian",
|
|
35
|
+
required: {
|
|
36
|
+
...x,
|
|
37
|
+
categories: "array",
|
|
38
|
+
series: "array",
|
|
39
|
+
valueFormat: "object"
|
|
40
|
+
},
|
|
41
|
+
isSelectable: !0
|
|
42
|
+
},
|
|
43
|
+
BridgeChart: {
|
|
44
|
+
chart: "BridgeChart",
|
|
45
|
+
component: e,
|
|
46
|
+
family: "cartesian",
|
|
47
|
+
required: {
|
|
48
|
+
...x,
|
|
49
|
+
steps: "array",
|
|
50
|
+
valueFormat: "object"
|
|
51
|
+
},
|
|
52
|
+
isSelectable: !0
|
|
53
|
+
},
|
|
54
|
+
BreakdownBar: {
|
|
55
|
+
chart: "BreakdownBar",
|
|
56
|
+
component: t,
|
|
57
|
+
family: "cartesian",
|
|
58
|
+
required: {
|
|
59
|
+
...x,
|
|
60
|
+
items: "array",
|
|
61
|
+
total: "number",
|
|
62
|
+
valueFormat: "object"
|
|
63
|
+
},
|
|
64
|
+
isSelectable: !0
|
|
65
|
+
},
|
|
66
|
+
ScatterPlot: {
|
|
67
|
+
chart: "ScatterPlot",
|
|
68
|
+
component: n,
|
|
69
|
+
family: "cartesian",
|
|
70
|
+
required: {
|
|
71
|
+
...x,
|
|
72
|
+
points: "array",
|
|
73
|
+
x: "object",
|
|
74
|
+
y: "object"
|
|
75
|
+
},
|
|
76
|
+
isSelectable: !0
|
|
77
|
+
},
|
|
78
|
+
LineChart: {
|
|
79
|
+
chart: "LineChart",
|
|
80
|
+
component: r,
|
|
81
|
+
family: "cartesian",
|
|
82
|
+
required: {
|
|
83
|
+
...x,
|
|
84
|
+
series: "array",
|
|
85
|
+
timestampUnit: "string",
|
|
86
|
+
timeFormat: "object",
|
|
87
|
+
valueFormat: "object"
|
|
88
|
+
},
|
|
89
|
+
isSelectable: !1
|
|
90
|
+
},
|
|
91
|
+
AreaChart: {
|
|
92
|
+
chart: "AreaChart",
|
|
93
|
+
component: s,
|
|
94
|
+
family: "cartesian",
|
|
95
|
+
required: {
|
|
96
|
+
...x,
|
|
97
|
+
series: "array",
|
|
98
|
+
timestampUnit: "string",
|
|
99
|
+
timeFormat: "object",
|
|
100
|
+
valueFormat: "object"
|
|
101
|
+
},
|
|
102
|
+
isSelectable: !1
|
|
103
|
+
},
|
|
104
|
+
SmallMultiples: {
|
|
105
|
+
chart: "SmallMultiples",
|
|
106
|
+
component: a,
|
|
107
|
+
family: "cartesian",
|
|
108
|
+
required: {
|
|
109
|
+
locale: "string",
|
|
110
|
+
charts: "array",
|
|
111
|
+
timestampUnit: "string",
|
|
112
|
+
timeFormat: "object"
|
|
113
|
+
},
|
|
114
|
+
isSelectable: !1
|
|
115
|
+
},
|
|
116
|
+
Sparkline: {
|
|
117
|
+
chart: "Sparkline",
|
|
118
|
+
component: o,
|
|
119
|
+
family: "cartesian",
|
|
120
|
+
required: {
|
|
121
|
+
title: "string",
|
|
122
|
+
summary: "string",
|
|
123
|
+
unit: "string",
|
|
124
|
+
timestampUnit: "string",
|
|
125
|
+
series: "object",
|
|
126
|
+
valueDomain: "array"
|
|
127
|
+
},
|
|
128
|
+
isSelectable: !1
|
|
129
|
+
},
|
|
130
|
+
Histogram: {
|
|
131
|
+
chart: "Histogram",
|
|
132
|
+
component: f,
|
|
133
|
+
family: "distribution",
|
|
134
|
+
required: {
|
|
135
|
+
...x,
|
|
136
|
+
bins: "array",
|
|
137
|
+
value: "object",
|
|
138
|
+
count: "object"
|
|
139
|
+
},
|
|
140
|
+
isSelectable: !0
|
|
141
|
+
},
|
|
142
|
+
ECDF: {
|
|
143
|
+
chart: "ECDF",
|
|
144
|
+
component: p,
|
|
145
|
+
family: "distribution",
|
|
146
|
+
required: {
|
|
147
|
+
...x,
|
|
148
|
+
points: "array",
|
|
149
|
+
value: "object",
|
|
150
|
+
probability: "object"
|
|
151
|
+
},
|
|
152
|
+
isSelectable: !0
|
|
153
|
+
},
|
|
154
|
+
IntervalPlot: {
|
|
155
|
+
chart: "IntervalPlot",
|
|
156
|
+
component: ie,
|
|
157
|
+
family: "distribution",
|
|
158
|
+
required: {
|
|
159
|
+
...x,
|
|
160
|
+
items: "array",
|
|
161
|
+
value: "object",
|
|
162
|
+
intervalLabel: "string"
|
|
163
|
+
},
|
|
164
|
+
isSelectable: !0
|
|
165
|
+
},
|
|
166
|
+
RankedBars: {
|
|
167
|
+
chart: "RankedBars",
|
|
168
|
+
component: ee,
|
|
169
|
+
family: "distribution",
|
|
170
|
+
required: {
|
|
171
|
+
...x,
|
|
172
|
+
items: "array",
|
|
173
|
+
value: "object"
|
|
174
|
+
},
|
|
175
|
+
isSelectable: !0
|
|
176
|
+
},
|
|
177
|
+
BoxPlot: {
|
|
178
|
+
chart: "BoxPlot",
|
|
179
|
+
component: ne,
|
|
180
|
+
family: "distribution",
|
|
181
|
+
required: {
|
|
182
|
+
...x,
|
|
183
|
+
groups: "array",
|
|
184
|
+
value: "object",
|
|
185
|
+
whiskerLabel: "string"
|
|
186
|
+
},
|
|
187
|
+
isSelectable: !1
|
|
188
|
+
},
|
|
189
|
+
ViolinPlot: {
|
|
190
|
+
chart: "ViolinPlot",
|
|
191
|
+
component: re,
|
|
192
|
+
family: "distribution",
|
|
193
|
+
required: {
|
|
194
|
+
...x,
|
|
195
|
+
groups: "array",
|
|
196
|
+
value: "object",
|
|
197
|
+
densityLabel: "string"
|
|
198
|
+
},
|
|
199
|
+
isSelectable: !1
|
|
200
|
+
},
|
|
201
|
+
StripPlot: {
|
|
202
|
+
chart: "StripPlot",
|
|
203
|
+
component: te,
|
|
204
|
+
family: "distribution",
|
|
205
|
+
required: {
|
|
206
|
+
...x,
|
|
207
|
+
groups: "array",
|
|
208
|
+
points: "array",
|
|
209
|
+
value: "object"
|
|
210
|
+
},
|
|
211
|
+
isSelectable: !0
|
|
212
|
+
},
|
|
213
|
+
Ridgeline: {
|
|
214
|
+
chart: "Ridgeline",
|
|
215
|
+
component: d,
|
|
216
|
+
family: "distribution",
|
|
217
|
+
required: {
|
|
218
|
+
...x,
|
|
219
|
+
rows: "array",
|
|
220
|
+
value: "object",
|
|
221
|
+
densityLabel: "string"
|
|
222
|
+
},
|
|
223
|
+
isSelectable: !1
|
|
224
|
+
},
|
|
225
|
+
Matrix: {
|
|
226
|
+
chart: "Matrix",
|
|
227
|
+
component: ge,
|
|
228
|
+
family: "matrix",
|
|
229
|
+
required: {
|
|
230
|
+
...x,
|
|
231
|
+
rows: "array",
|
|
232
|
+
columns: "array",
|
|
233
|
+
cells: "array",
|
|
234
|
+
valueLabel: "string",
|
|
235
|
+
valueFormat: "object",
|
|
236
|
+
domain: "array",
|
|
237
|
+
palette: "string"
|
|
238
|
+
},
|
|
239
|
+
isSelectable: !0
|
|
240
|
+
},
|
|
241
|
+
TokenHeatmap: {
|
|
242
|
+
chart: "TokenHeatmap",
|
|
243
|
+
component: _e,
|
|
244
|
+
family: "matrix",
|
|
245
|
+
required: {
|
|
246
|
+
...x,
|
|
247
|
+
tokens: "array",
|
|
248
|
+
valueLabel: "string",
|
|
249
|
+
valueFormat: "object",
|
|
250
|
+
domain: "array",
|
|
251
|
+
palette: "string"
|
|
252
|
+
},
|
|
253
|
+
isSelectable: !0
|
|
254
|
+
},
|
|
255
|
+
ConfusionMatrix: {
|
|
256
|
+
chart: "ConfusionMatrix",
|
|
257
|
+
component: m,
|
|
258
|
+
family: "matrix",
|
|
259
|
+
required: {
|
|
260
|
+
...x,
|
|
261
|
+
classes: "array",
|
|
262
|
+
counts: "array"
|
|
263
|
+
},
|
|
264
|
+
isSelectable: !0
|
|
265
|
+
},
|
|
266
|
+
CorrelationMatrix: {
|
|
267
|
+
chart: "CorrelationMatrix",
|
|
268
|
+
component: he,
|
|
269
|
+
family: "matrix",
|
|
270
|
+
required: {
|
|
271
|
+
...x,
|
|
272
|
+
variables: "array",
|
|
273
|
+
coefficients: "array"
|
|
274
|
+
},
|
|
275
|
+
isSelectable: !0
|
|
276
|
+
},
|
|
277
|
+
AttentionMatrix: {
|
|
278
|
+
chart: "AttentionMatrix",
|
|
279
|
+
component: ve,
|
|
280
|
+
family: "matrix",
|
|
281
|
+
required: {
|
|
282
|
+
...x,
|
|
283
|
+
sources: "array",
|
|
284
|
+
destinations: "array",
|
|
285
|
+
weights: "array"
|
|
286
|
+
},
|
|
287
|
+
isSelectable: !0
|
|
288
|
+
},
|
|
289
|
+
CalendarHeatmap: {
|
|
290
|
+
chart: "CalendarHeatmap",
|
|
291
|
+
component: me,
|
|
292
|
+
family: "matrix",
|
|
293
|
+
required: {
|
|
294
|
+
...x,
|
|
295
|
+
days: "array",
|
|
296
|
+
range: "object",
|
|
297
|
+
weekStartsOn: "string",
|
|
298
|
+
valueLabel: "string",
|
|
299
|
+
valueFormat: "object"
|
|
300
|
+
},
|
|
301
|
+
isSelectable: !0
|
|
302
|
+
},
|
|
303
|
+
RelationGraph: {
|
|
304
|
+
chart: "RelationGraph",
|
|
305
|
+
component: ae,
|
|
306
|
+
family: "graph",
|
|
307
|
+
required: {
|
|
308
|
+
...x,
|
|
309
|
+
nodes: "array",
|
|
310
|
+
edges: "array",
|
|
311
|
+
width: "number",
|
|
312
|
+
height: "number"
|
|
313
|
+
},
|
|
314
|
+
isSelectable: !0
|
|
315
|
+
},
|
|
316
|
+
FlowDiagram: {
|
|
317
|
+
chart: "FlowDiagram",
|
|
318
|
+
component: se,
|
|
319
|
+
family: "graph",
|
|
320
|
+
required: {
|
|
321
|
+
...x,
|
|
322
|
+
nodes: "array",
|
|
323
|
+
links: "array",
|
|
324
|
+
valueFormat: "object"
|
|
325
|
+
},
|
|
326
|
+
isSelectable: !0
|
|
327
|
+
},
|
|
328
|
+
AttributionGraph: {
|
|
329
|
+
chart: "AttributionGraph",
|
|
330
|
+
component: oe,
|
|
331
|
+
family: "graph",
|
|
332
|
+
required: {
|
|
333
|
+
...x,
|
|
334
|
+
layers: "array",
|
|
335
|
+
nodes: "array",
|
|
336
|
+
edges: "array",
|
|
337
|
+
weightLabel: "string",
|
|
338
|
+
weightFormat: "object"
|
|
339
|
+
},
|
|
340
|
+
isSelectable: !0
|
|
341
|
+
},
|
|
342
|
+
TreeDiagram: {
|
|
343
|
+
chart: "TreeDiagram",
|
|
344
|
+
component: ce,
|
|
345
|
+
family: "graph",
|
|
346
|
+
required: {
|
|
347
|
+
...x,
|
|
348
|
+
nodes: "array"
|
|
349
|
+
},
|
|
350
|
+
isSelectable: !0
|
|
351
|
+
},
|
|
352
|
+
Treemap: {
|
|
353
|
+
chart: "Treemap",
|
|
354
|
+
component: ue,
|
|
355
|
+
family: "hierarchy",
|
|
356
|
+
required: {
|
|
357
|
+
...x,
|
|
358
|
+
items: "array",
|
|
359
|
+
valueFormat: "object"
|
|
360
|
+
},
|
|
361
|
+
isSelectable: !0
|
|
362
|
+
},
|
|
363
|
+
Icicle: {
|
|
364
|
+
chart: "Icicle",
|
|
365
|
+
component: le,
|
|
366
|
+
family: "hierarchy",
|
|
367
|
+
required: {
|
|
368
|
+
...x,
|
|
369
|
+
nodes: "array",
|
|
370
|
+
valueFormat: "object"
|
|
371
|
+
},
|
|
372
|
+
isSelectable: !0
|
|
373
|
+
},
|
|
374
|
+
Waterfall: {
|
|
375
|
+
chart: "Waterfall",
|
|
376
|
+
component: Le,
|
|
377
|
+
family: "timeline",
|
|
378
|
+
required: {
|
|
379
|
+
...x,
|
|
380
|
+
items: "array",
|
|
381
|
+
start: "number",
|
|
382
|
+
end: "number",
|
|
383
|
+
rowLabel: "string",
|
|
384
|
+
summaryLabel: "string",
|
|
385
|
+
offsetFormat: "object"
|
|
386
|
+
},
|
|
387
|
+
isSelectable: !0
|
|
388
|
+
},
|
|
389
|
+
EventStrip: {
|
|
390
|
+
chart: "EventStrip",
|
|
391
|
+
component: De,
|
|
392
|
+
family: "timeline",
|
|
393
|
+
required: {
|
|
394
|
+
...x,
|
|
395
|
+
lanes: "array",
|
|
396
|
+
events: "array",
|
|
397
|
+
domain: "array",
|
|
398
|
+
timeFormat: "object"
|
|
399
|
+
},
|
|
400
|
+
isSelectable: !0
|
|
401
|
+
},
|
|
402
|
+
CurveChart: {
|
|
403
|
+
chart: "CurveChart",
|
|
404
|
+
component: Me,
|
|
405
|
+
family: "trend",
|
|
406
|
+
required: {
|
|
407
|
+
...x,
|
|
408
|
+
series: "array",
|
|
409
|
+
x: "object",
|
|
410
|
+
y: "object"
|
|
411
|
+
},
|
|
412
|
+
isSelectable: !1
|
|
413
|
+
},
|
|
414
|
+
RunsChart: {
|
|
415
|
+
chart: "RunsChart",
|
|
416
|
+
component: je,
|
|
417
|
+
family: "trend",
|
|
418
|
+
required: {
|
|
419
|
+
...x,
|
|
420
|
+
runs: "array",
|
|
421
|
+
x: "object",
|
|
422
|
+
y: "object",
|
|
423
|
+
featured: "array"
|
|
424
|
+
},
|
|
425
|
+
isSelectable: !0
|
|
426
|
+
},
|
|
427
|
+
SlopeChart: {
|
|
428
|
+
chart: "SlopeChart",
|
|
429
|
+
component: Ne,
|
|
430
|
+
family: "trend",
|
|
431
|
+
required: {
|
|
432
|
+
...x,
|
|
433
|
+
conditions: "array",
|
|
434
|
+
items: "array",
|
|
435
|
+
value: "object"
|
|
436
|
+
},
|
|
437
|
+
isSelectable: !0
|
|
438
|
+
},
|
|
439
|
+
BumpChart: {
|
|
440
|
+
chart: "BumpChart",
|
|
441
|
+
component: Ae,
|
|
442
|
+
family: "trend",
|
|
443
|
+
required: {
|
|
444
|
+
...x,
|
|
445
|
+
stages: "array",
|
|
446
|
+
items: "array"
|
|
447
|
+
},
|
|
448
|
+
isSelectable: !1
|
|
449
|
+
},
|
|
450
|
+
HorizonChart: {
|
|
451
|
+
chart: "HorizonChart",
|
|
452
|
+
component: ke,
|
|
453
|
+
family: "trend",
|
|
454
|
+
required: {
|
|
455
|
+
...x,
|
|
456
|
+
series: "array",
|
|
457
|
+
x: "object",
|
|
458
|
+
value: "object",
|
|
459
|
+
bands: "number"
|
|
460
|
+
},
|
|
461
|
+
isSelectable: !1
|
|
462
|
+
},
|
|
463
|
+
DotPlot: {
|
|
464
|
+
chart: "DotPlot",
|
|
465
|
+
component: l,
|
|
466
|
+
family: "comparison",
|
|
467
|
+
required: {
|
|
468
|
+
...x,
|
|
469
|
+
rows: "array",
|
|
470
|
+
series: "array",
|
|
471
|
+
value: "object"
|
|
472
|
+
},
|
|
473
|
+
isSelectable: !0
|
|
474
|
+
},
|
|
475
|
+
DumbbellPlot: {
|
|
476
|
+
chart: "DumbbellPlot",
|
|
477
|
+
component: u,
|
|
478
|
+
family: "comparison",
|
|
479
|
+
required: {
|
|
480
|
+
...x,
|
|
481
|
+
rows: "array",
|
|
482
|
+
fromLabel: "string",
|
|
483
|
+
toLabel: "string",
|
|
484
|
+
value: "object"
|
|
485
|
+
},
|
|
486
|
+
isSelectable: !0
|
|
487
|
+
},
|
|
488
|
+
BulletBar: {
|
|
489
|
+
chart: "BulletBar",
|
|
490
|
+
component: c,
|
|
491
|
+
family: "comparison",
|
|
492
|
+
required: {
|
|
493
|
+
...x,
|
|
494
|
+
rows: "array",
|
|
495
|
+
value: "object"
|
|
496
|
+
},
|
|
497
|
+
isSelectable: !0
|
|
498
|
+
},
|
|
499
|
+
ContourPlot: {
|
|
500
|
+
chart: "ContourPlot",
|
|
501
|
+
component: be,
|
|
502
|
+
family: "relationship",
|
|
503
|
+
required: {
|
|
504
|
+
...x,
|
|
505
|
+
grid: "object",
|
|
506
|
+
levels: "array",
|
|
507
|
+
x: "object",
|
|
508
|
+
y: "object",
|
|
509
|
+
value: "object"
|
|
510
|
+
},
|
|
511
|
+
isSelectable: !0
|
|
512
|
+
},
|
|
513
|
+
ScatterMatrix: {
|
|
514
|
+
chart: "ScatterMatrix",
|
|
515
|
+
component: ye,
|
|
516
|
+
family: "relationship",
|
|
517
|
+
required: {
|
|
518
|
+
...x,
|
|
519
|
+
dimensions: "array",
|
|
520
|
+
rows: "array"
|
|
521
|
+
},
|
|
522
|
+
isSelectable: !0
|
|
523
|
+
},
|
|
524
|
+
ParallelCoordinates: {
|
|
525
|
+
chart: "ParallelCoordinates",
|
|
526
|
+
component: Se,
|
|
527
|
+
family: "relationship",
|
|
528
|
+
required: {
|
|
529
|
+
...x,
|
|
530
|
+
dimensions: "array",
|
|
531
|
+
rows: "array"
|
|
532
|
+
},
|
|
533
|
+
isSelectable: !0
|
|
534
|
+
},
|
|
535
|
+
EmbeddingMap: {
|
|
536
|
+
chart: "EmbeddingMap",
|
|
537
|
+
component: Ce,
|
|
538
|
+
family: "relationship",
|
|
539
|
+
required: {
|
|
540
|
+
...x,
|
|
541
|
+
points: "object",
|
|
542
|
+
groups: "array",
|
|
543
|
+
x: "object",
|
|
544
|
+
y: "object"
|
|
545
|
+
},
|
|
546
|
+
isSelectable: !0
|
|
547
|
+
},
|
|
548
|
+
DensityMap: {
|
|
549
|
+
chart: "DensityMap",
|
|
550
|
+
component: xe,
|
|
551
|
+
family: "relationship",
|
|
552
|
+
required: {
|
|
553
|
+
...x,
|
|
554
|
+
histogram: "object",
|
|
555
|
+
x: "object",
|
|
556
|
+
y: "object",
|
|
557
|
+
count: "object"
|
|
558
|
+
},
|
|
559
|
+
isSelectable: !1
|
|
560
|
+
},
|
|
561
|
+
TokenExamples: {
|
|
562
|
+
chart: "TokenExamples",
|
|
563
|
+
component: Te,
|
|
564
|
+
family: "text",
|
|
565
|
+
required: {
|
|
566
|
+
...x,
|
|
567
|
+
examples: "array",
|
|
568
|
+
valueLabel: "string",
|
|
569
|
+
valueFormat: "object",
|
|
570
|
+
domain: "array",
|
|
571
|
+
palette: "string"
|
|
572
|
+
},
|
|
573
|
+
isSelectable: !0
|
|
574
|
+
},
|
|
575
|
+
TokenPredictions: {
|
|
576
|
+
chart: "TokenPredictions",
|
|
577
|
+
component: Ee,
|
|
578
|
+
family: "text",
|
|
579
|
+
required: {
|
|
580
|
+
...x,
|
|
581
|
+
predictions: "array"
|
|
582
|
+
},
|
|
583
|
+
isSelectable: !0
|
|
584
|
+
},
|
|
585
|
+
TokenGrid: {
|
|
586
|
+
chart: "TokenGrid",
|
|
587
|
+
component: we,
|
|
588
|
+
family: "text",
|
|
589
|
+
required: {
|
|
590
|
+
...x,
|
|
591
|
+
columns: "array",
|
|
592
|
+
rows: "array",
|
|
593
|
+
cells: "array",
|
|
594
|
+
valueLabel: "string",
|
|
595
|
+
valueFormat: "object",
|
|
596
|
+
domain: "array",
|
|
597
|
+
palette: "string"
|
|
598
|
+
},
|
|
599
|
+
isSelectable: !0
|
|
600
|
+
},
|
|
601
|
+
TokenLinks: {
|
|
602
|
+
chart: "TokenLinks",
|
|
603
|
+
component: h,
|
|
604
|
+
family: "text",
|
|
605
|
+
required: {
|
|
606
|
+
...x,
|
|
607
|
+
tokens: "array",
|
|
608
|
+
links: "array",
|
|
609
|
+
weightLabel: "string",
|
|
610
|
+
valueFormat: "object",
|
|
611
|
+
domain: "array",
|
|
612
|
+
direction: "string"
|
|
613
|
+
},
|
|
614
|
+
isSelectable: !0
|
|
615
|
+
},
|
|
616
|
+
ImageGrid: {
|
|
617
|
+
chart: "ImageGrid",
|
|
618
|
+
component: pe,
|
|
619
|
+
family: "image",
|
|
620
|
+
required: {
|
|
621
|
+
...x,
|
|
622
|
+
items: "array"
|
|
623
|
+
},
|
|
624
|
+
isSelectable: !0
|
|
625
|
+
},
|
|
626
|
+
AttributionOverlay: {
|
|
627
|
+
chart: "AttributionOverlay",
|
|
628
|
+
component: de,
|
|
629
|
+
family: "image",
|
|
630
|
+
required: {
|
|
631
|
+
...x,
|
|
632
|
+
image: "object",
|
|
633
|
+
grid: "object",
|
|
634
|
+
valueLabel: "string",
|
|
635
|
+
valueFormat: "object",
|
|
636
|
+
domain: "array",
|
|
637
|
+
palette: "string"
|
|
638
|
+
},
|
|
639
|
+
isSelectable: !1
|
|
640
|
+
},
|
|
641
|
+
ImageAtlas: {
|
|
642
|
+
chart: "ImageAtlas",
|
|
643
|
+
component: fe,
|
|
644
|
+
family: "image",
|
|
645
|
+
required: {
|
|
646
|
+
...x,
|
|
647
|
+
columns: "number",
|
|
648
|
+
rows: "number",
|
|
649
|
+
cells: "array"
|
|
650
|
+
},
|
|
651
|
+
isSelectable: !0
|
|
652
|
+
}
|
|
653
|
+
}, Re = Object.values(S).map(({ chart: e, family: t }) => ({
|
|
654
|
+
chart: e,
|
|
655
|
+
family: t
|
|
656
|
+
})), ze = .5, C = 1e3, w = 1e4, T = 1e6, E = Math.PI + Math.PI, Be = {
|
|
657
|
+
timeZone: "UTC",
|
|
658
|
+
year: "numeric",
|
|
659
|
+
month: "2-digit",
|
|
660
|
+
day: "2-digit"
|
|
661
|
+
}, D = 96, Ve = 47, He = 360, Ue = 26, We = 62, Ge = 30;
|
|
662
|
+
function O(e) {
|
|
663
|
+
return Math.round(e * C) / C;
|
|
664
|
+
}
|
|
665
|
+
function k({ count: e, start: t = 0, step: n = 1 }) {
|
|
666
|
+
return Array.from({ length: e }, (e, r) => O(t + r * n));
|
|
667
|
+
}
|
|
668
|
+
function A({ xs: e, start: t, floor: n, rate: r, spread: i }) {
|
|
669
|
+
let a = e[0] ?? 1;
|
|
670
|
+
return e.map((e) => {
|
|
671
|
+
let o = n + (t - n) * Math.exp(-r * Math.log10(e / a));
|
|
672
|
+
return i === void 0 ? {
|
|
673
|
+
x: e,
|
|
674
|
+
y: O(o)
|
|
675
|
+
} : {
|
|
676
|
+
x: e,
|
|
677
|
+
y: O(o),
|
|
678
|
+
lower: O(o * (1 - i)),
|
|
679
|
+
upper: O(o * (1 + i))
|
|
680
|
+
};
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
function j({ count: e, base: t, amplitude: n, cycle: r, phase: i = 0, trend: a = 0 }) {
|
|
684
|
+
return Array.from({ length: e }, (e, o) => O(t + n * Math.sin((o + i) / r * E) + a * o));
|
|
685
|
+
}
|
|
686
|
+
function M({ start: e, step: t, values: n }) {
|
|
687
|
+
return n.map((n, r) => ({
|
|
688
|
+
timestamp: e + r * t,
|
|
689
|
+
value: n
|
|
690
|
+
}));
|
|
691
|
+
}
|
|
692
|
+
function N({ center: e, width: t, from: n, to: r, count: i }) {
|
|
693
|
+
let a = (r - n) / (i - 1);
|
|
694
|
+
return Array.from({ length: i }, (r, i) => {
|
|
695
|
+
let o = n + i * a, s = (o - e) / t;
|
|
696
|
+
return {
|
|
697
|
+
value: O(o),
|
|
698
|
+
density: Math.round(T * Math.exp(-.5 * s * s) / (t * Math.sqrt(E))) / T
|
|
699
|
+
};
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
function P({ columns: e, rows: t, peaks: n }) {
|
|
703
|
+
return Array.from({ length: t * e }, (t, r) => {
|
|
704
|
+
let i = r % e, a = Math.floor(r / e);
|
|
705
|
+
return O(g(n.map((e) => {
|
|
706
|
+
let t = (i - e.x) / e.width, n = (a - e.y) / e.width;
|
|
707
|
+
return e.height * Math.exp(-.5 * (t * t + n * n));
|
|
708
|
+
})));
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
function Ke({ start: e, step: t, count: n }) {
|
|
712
|
+
let r = Fe("en-CA", Be);
|
|
713
|
+
return Array.from({ length: n }, (n, i) => r.format(e + i * t));
|
|
714
|
+
}
|
|
715
|
+
function F(e) {
|
|
716
|
+
return Math.round(e * w) / w;
|
|
717
|
+
}
|
|
718
|
+
function I(e) {
|
|
719
|
+
let t = e * Ve % He, n = D * ze, r = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${D} ${D}"><rect width="${D}" height="${D}" fill="hsl(${t} 60% ${We}%)"/><rect y="${n}" width="${D}" height="${n}" fill="hsl(${t} 55% ${Ge}%)"/><circle cx="${n}" cy="${n}" r="${Ue}" fill="white"/></svg>`;
|
|
720
|
+
return `data:image/svg+xml,${encodeURIComponent(r)}`;
|
|
721
|
+
}
|
|
722
|
+
// packages/charts/src/spec/chart-guide.tsx
|
|
723
|
+
var L = {
|
|
724
|
+
start: Date.UTC(2026, 10, 16),
|
|
725
|
+
hour: 36e5,
|
|
726
|
+
minute: 6e4,
|
|
727
|
+
day: 864e5,
|
|
728
|
+
clock: {
|
|
729
|
+
hour: "2-digit",
|
|
730
|
+
minute: "2-digit",
|
|
731
|
+
hourCycle: "h23",
|
|
732
|
+
timeZone: "UTC"
|
|
733
|
+
},
|
|
734
|
+
date: {
|
|
735
|
+
month: "short",
|
|
736
|
+
day: "numeric",
|
|
737
|
+
timeZone: "UTC"
|
|
738
|
+
}
|
|
739
|
+
}, R = {
|
|
740
|
+
integer: { maximumFractionDigits: 0 },
|
|
741
|
+
decimal: { maximumFractionDigits: 2 },
|
|
742
|
+
percent: {
|
|
743
|
+
style: "percent",
|
|
744
|
+
maximumFractionDigits: 1
|
|
745
|
+
},
|
|
746
|
+
milliseconds: {
|
|
747
|
+
style: "unit",
|
|
748
|
+
unit: "millisecond",
|
|
749
|
+
unitDisplay: "short",
|
|
750
|
+
maximumFractionDigits: 0
|
|
751
|
+
},
|
|
752
|
+
dollars: {
|
|
753
|
+
style: "currency",
|
|
754
|
+
currency: "USD",
|
|
755
|
+
maximumFractionDigits: 0
|
|
756
|
+
}
|
|
757
|
+
}, z = [
|
|
758
|
+
100,
|
|
759
|
+
200,
|
|
760
|
+
500,
|
|
761
|
+
1e3,
|
|
762
|
+
2e3,
|
|
763
|
+
5e3,
|
|
764
|
+
1e4,
|
|
765
|
+
2e4,
|
|
766
|
+
5e4,
|
|
767
|
+
1e5
|
|
768
|
+
], B = [
|
|
769
|
+
{
|
|
770
|
+
id: "mmlu",
|
|
771
|
+
label: "MMLU"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
id: "gsm8k",
|
|
775
|
+
label: "GSM8K"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
id: "humaneval",
|
|
779
|
+
label: "HumanEval"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
id: "arc",
|
|
783
|
+
label: "ARC-Challenge"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
id: "truthfulqa",
|
|
787
|
+
label: "TruthfulQA"
|
|
788
|
+
}
|
|
789
|
+
], V = [
|
|
790
|
+
"The",
|
|
791
|
+
" cat",
|
|
792
|
+
" sat",
|
|
793
|
+
" on",
|
|
794
|
+
" the",
|
|
795
|
+
" mat",
|
|
796
|
+
" because",
|
|
797
|
+
" it",
|
|
798
|
+
" was",
|
|
799
|
+
" warm"
|
|
800
|
+
], H = V.map((e, t) => ({
|
|
801
|
+
id: `t${t}`,
|
|
802
|
+
index: t,
|
|
803
|
+
text: e
|
|
804
|
+
})), qe = {
|
|
805
|
+
CurveChart: {
|
|
806
|
+
question: "How did a metric change over training steps or another ordered variable?",
|
|
807
|
+
use: "Use it for loss, accuracy or any measure over steps, layers or doses, on linear or log axes, with bands for spread across seeds.",
|
|
808
|
+
avoid: "Use LineChart when the ordered variable is a timestamp, and RunsChart when there are dozens of runs to show as context.",
|
|
809
|
+
example: {
|
|
810
|
+
chart: "CurveChart",
|
|
811
|
+
props: {
|
|
812
|
+
title: "Validation loss",
|
|
813
|
+
description: "Synthetic runs. Bands span three seeds; the dashed line is a fitted power law.",
|
|
814
|
+
locale: "en-US",
|
|
815
|
+
series: [
|
|
816
|
+
{
|
|
817
|
+
id: "base",
|
|
818
|
+
label: "Base",
|
|
819
|
+
points: A({
|
|
820
|
+
xs: z,
|
|
821
|
+
start: 4.2,
|
|
822
|
+
floor: 1.9,
|
|
823
|
+
rate: 1.1,
|
|
824
|
+
spread: .06
|
|
825
|
+
})
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
id: "wide",
|
|
829
|
+
label: "Wide",
|
|
830
|
+
points: A({
|
|
831
|
+
xs: z,
|
|
832
|
+
start: 4.1,
|
|
833
|
+
floor: 1.6,
|
|
834
|
+
rate: 1.3,
|
|
835
|
+
spread: .06
|
|
836
|
+
})
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
id: "fit",
|
|
840
|
+
label: "Power-law fit",
|
|
841
|
+
stroke: "dashed",
|
|
842
|
+
tone: "neutral",
|
|
843
|
+
points: A({
|
|
844
|
+
xs: z,
|
|
845
|
+
start: 4,
|
|
846
|
+
floor: 1.4,
|
|
847
|
+
rate: 1
|
|
848
|
+
})
|
|
849
|
+
}
|
|
850
|
+
],
|
|
851
|
+
x: {
|
|
852
|
+
label: "Training step",
|
|
853
|
+
scale: "log",
|
|
854
|
+
format: R.integer
|
|
855
|
+
},
|
|
856
|
+
y: {
|
|
857
|
+
label: "Loss (nats)",
|
|
858
|
+
domain: [1, 5],
|
|
859
|
+
format: R.decimal
|
|
860
|
+
},
|
|
861
|
+
references: [{
|
|
862
|
+
id: "target",
|
|
863
|
+
label: "Target",
|
|
864
|
+
y: 1.75
|
|
865
|
+
}],
|
|
866
|
+
source: "Synthetic sweep",
|
|
867
|
+
transforms: ["Mean of three seeds"]
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
RunsChart: {
|
|
872
|
+
question: "How does one run compare with the whole sweep it belongs to?",
|
|
873
|
+
use: "Use it for many training runs at once: every run stays gray context and only the runs you name are drawn in color.",
|
|
874
|
+
avoid: "Use CurveChart for a handful of series that each deserve a color and a legend entry.",
|
|
875
|
+
example: {
|
|
876
|
+
chart: "RunsChart",
|
|
877
|
+
props: {
|
|
878
|
+
title: "Learning-rate sweep",
|
|
879
|
+
description: "Synthetic sweep of twelve runs. The featured runs are the best and the default.",
|
|
880
|
+
locale: "en-US",
|
|
881
|
+
runs: k({ count: 12 }).map((e) => ({
|
|
882
|
+
id: `run-${e}`,
|
|
883
|
+
label: `lr ${(e + 1) * .5}e-4`,
|
|
884
|
+
points: A({
|
|
885
|
+
xs: z,
|
|
886
|
+
start: 4.4,
|
|
887
|
+
floor: 1.7 + Math.abs(e - 5) * .08,
|
|
888
|
+
rate: .9 + e * .03
|
|
889
|
+
})
|
|
890
|
+
})),
|
|
891
|
+
featured: ["run-5", "run-1"],
|
|
892
|
+
x: {
|
|
893
|
+
label: "Training step",
|
|
894
|
+
scale: "log",
|
|
895
|
+
format: R.integer
|
|
896
|
+
},
|
|
897
|
+
y: {
|
|
898
|
+
label: "Loss (nats)",
|
|
899
|
+
domain: [1, 5],
|
|
900
|
+
format: R.decimal
|
|
901
|
+
},
|
|
902
|
+
source: "Synthetic sweep"
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
SlopeChart: {
|
|
907
|
+
question: "How did each item move between two to six conditions?",
|
|
908
|
+
use: "Use it to compare before and after, or a few checkpoints, where the direction of each change matters more than the path.",
|
|
909
|
+
avoid: "Use DumbbellPlot when there are many rows and exactly two conditions, and CurveChart when the conditions are many ordered steps.",
|
|
910
|
+
example: {
|
|
911
|
+
chart: "SlopeChart",
|
|
912
|
+
props: {
|
|
913
|
+
title: "Benchmark accuracy before and after tuning",
|
|
914
|
+
description: "Synthetic scores for five benchmarks.",
|
|
915
|
+
locale: "en-US",
|
|
916
|
+
conditions: [
|
|
917
|
+
{
|
|
918
|
+
id: "base",
|
|
919
|
+
label: "Base"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
id: "sft",
|
|
923
|
+
label: "Fine-tuned"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
id: "rl",
|
|
927
|
+
label: "After RL"
|
|
928
|
+
}
|
|
929
|
+
],
|
|
930
|
+
items: B.map((e, t) => ({
|
|
931
|
+
...e,
|
|
932
|
+
values: [
|
|
933
|
+
F(.52 + t * .05),
|
|
934
|
+
F(.6 + t * .04),
|
|
935
|
+
F(.63 + t * (t === 4 ? 0 : .045))
|
|
936
|
+
]
|
|
937
|
+
})),
|
|
938
|
+
value: {
|
|
939
|
+
label: "Accuracy",
|
|
940
|
+
domain: [.4, 1],
|
|
941
|
+
format: R.percent
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
BumpChart: {
|
|
947
|
+
question: "How did the ranking of items change across stages?",
|
|
948
|
+
use: "Use it when the order matters more than the values: a leaderboard over releases, or model rank per evaluation round.",
|
|
949
|
+
avoid: "Use SlopeChart or CurveChart when the size of the gaps between items matters.",
|
|
950
|
+
example: {
|
|
951
|
+
chart: "BumpChart",
|
|
952
|
+
props: {
|
|
953
|
+
title: "Leaderboard rank by release",
|
|
954
|
+
description: "Synthetic ranks of five models across four releases.",
|
|
955
|
+
locale: "en-US",
|
|
956
|
+
stages: [
|
|
957
|
+
"v1",
|
|
958
|
+
"v2",
|
|
959
|
+
"v3",
|
|
960
|
+
"v4"
|
|
961
|
+
].map((e) => ({
|
|
962
|
+
id: e,
|
|
963
|
+
label: e.toUpperCase()
|
|
964
|
+
})),
|
|
965
|
+
items: [
|
|
966
|
+
{
|
|
967
|
+
id: "atlas",
|
|
968
|
+
label: "Atlas",
|
|
969
|
+
ranks: [
|
|
970
|
+
1,
|
|
971
|
+
1,
|
|
972
|
+
2,
|
|
973
|
+
3
|
|
974
|
+
]
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
id: "boreal",
|
|
978
|
+
label: "Boreal",
|
|
979
|
+
ranks: [
|
|
980
|
+
3,
|
|
981
|
+
2,
|
|
982
|
+
1,
|
|
983
|
+
1
|
|
984
|
+
]
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
id: "cirrus",
|
|
988
|
+
label: "Cirrus",
|
|
989
|
+
ranks: [
|
|
990
|
+
2,
|
|
991
|
+
3,
|
|
992
|
+
3,
|
|
993
|
+
2
|
|
994
|
+
]
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
id: "delta",
|
|
998
|
+
label: "Delta",
|
|
999
|
+
ranks: [
|
|
1000
|
+
5,
|
|
1001
|
+
4,
|
|
1002
|
+
4,
|
|
1003
|
+
5
|
|
1004
|
+
]
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
id: "ember",
|
|
1008
|
+
label: "Ember",
|
|
1009
|
+
ranks: [
|
|
1010
|
+
4,
|
|
1011
|
+
5,
|
|
1012
|
+
5,
|
|
1013
|
+
4
|
|
1014
|
+
]
|
|
1015
|
+
}
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
HorizonChart: {
|
|
1021
|
+
question: "Which of many series run above or below normal, and when?",
|
|
1022
|
+
use: "Use it for dozens of aligned series in little height, such as the error rate of every service over a day.",
|
|
1023
|
+
avoid: "Use LineChart or SmallMultiples when there are only a few series and readers need exact levels.",
|
|
1024
|
+
example: {
|
|
1025
|
+
chart: "HorizonChart",
|
|
1026
|
+
props: {
|
|
1027
|
+
title: "Error rate against baseline by service",
|
|
1028
|
+
description: "Synthetic deviation from each service’s weekly baseline, in percentage points.",
|
|
1029
|
+
locale: "en-US",
|
|
1030
|
+
series: [
|
|
1031
|
+
"gateway",
|
|
1032
|
+
"tokenizer",
|
|
1033
|
+
"scheduler",
|
|
1034
|
+
"retrieval",
|
|
1035
|
+
"inference",
|
|
1036
|
+
"billing"
|
|
1037
|
+
].map((e, t) => ({
|
|
1038
|
+
id: e,
|
|
1039
|
+
label: e[0]?.toUpperCase() + e.slice(1),
|
|
1040
|
+
points: j({
|
|
1041
|
+
count: 48,
|
|
1042
|
+
base: 0,
|
|
1043
|
+
amplitude: 1.2 + t * .3,
|
|
1044
|
+
cycle: 16 + t * 3,
|
|
1045
|
+
phase: t * 4
|
|
1046
|
+
}).map((e, t) => ({
|
|
1047
|
+
x: t * .5,
|
|
1048
|
+
y: e
|
|
1049
|
+
}))
|
|
1050
|
+
})),
|
|
1051
|
+
x: {
|
|
1052
|
+
label: "Hour of day (UTC)",
|
|
1053
|
+
domain: [0, 24],
|
|
1054
|
+
format: R.integer
|
|
1055
|
+
},
|
|
1056
|
+
value: {
|
|
1057
|
+
label: "Deviation (points)",
|
|
1058
|
+
domain: [-3, 3],
|
|
1059
|
+
format: R.decimal
|
|
1060
|
+
},
|
|
1061
|
+
bands: 3
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
DotPlot: {
|
|
1066
|
+
question: "How do a few models compare on each of several measures?",
|
|
1067
|
+
use: "Use it to compare values across categories without bars, when the axis need not start at zero and intervals matter.",
|
|
1068
|
+
avoid: "Use BarChart when the amount itself, measured from zero, is the point.",
|
|
1069
|
+
example: {
|
|
1070
|
+
chart: "DotPlot",
|
|
1071
|
+
props: {
|
|
1072
|
+
title: "Accuracy by benchmark",
|
|
1073
|
+
description: "Synthetic scores with 95% bootstrap intervals.",
|
|
1074
|
+
locale: "en-US",
|
|
1075
|
+
rows: B,
|
|
1076
|
+
series: [{
|
|
1077
|
+
id: "small",
|
|
1078
|
+
label: "Small",
|
|
1079
|
+
offset: 0
|
|
1080
|
+
}, {
|
|
1081
|
+
id: "large",
|
|
1082
|
+
label: "Large",
|
|
1083
|
+
offset: .12
|
|
1084
|
+
}].map(({ id: e, label: t, offset: n }) => ({
|
|
1085
|
+
id: e,
|
|
1086
|
+
label: t,
|
|
1087
|
+
values: Object.fromEntries(B.map((e, t) => [e.id, F(.5 + n + t * .04)])),
|
|
1088
|
+
intervals: Object.fromEntries(B.map((e, t) => [e.id, {
|
|
1089
|
+
lower: F(.47 + n + t * .04),
|
|
1090
|
+
upper: F(.53 + n + t * .04)
|
|
1091
|
+
}]))
|
|
1092
|
+
})),
|
|
1093
|
+
value: {
|
|
1094
|
+
label: "Accuracy",
|
|
1095
|
+
domain: [.4, .9],
|
|
1096
|
+
format: R.percent
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
DumbbellPlot: {
|
|
1102
|
+
question: "How much did each row change between two measurements?",
|
|
1103
|
+
use: "Use it for many rows with exactly two values each, such as scores before and after fine-tuning.",
|
|
1104
|
+
avoid: "Use SlopeChart for few rows or more than two conditions, and BridgeChart for how parts add up to a total change.",
|
|
1105
|
+
example: {
|
|
1106
|
+
chart: "DumbbellPlot",
|
|
1107
|
+
props: {
|
|
1108
|
+
title: "Accuracy before and after fine-tuning",
|
|
1109
|
+
description: "Synthetic scores for five benchmarks.",
|
|
1110
|
+
locale: "en-US",
|
|
1111
|
+
rows: B.map((e, t) => ({
|
|
1112
|
+
...e,
|
|
1113
|
+
from: F(.48 + t * .05),
|
|
1114
|
+
to: F(.58 + t * .05 - (t === 4 ? .13 : 0))
|
|
1115
|
+
})),
|
|
1116
|
+
fromLabel: "Before fine-tuning",
|
|
1117
|
+
toLabel: "After fine-tuning",
|
|
1118
|
+
value: {
|
|
1119
|
+
label: "Accuracy",
|
|
1120
|
+
domain: [.4, .9],
|
|
1121
|
+
format: R.percent
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
},
|
|
1126
|
+
BulletBar: {
|
|
1127
|
+
question: "Is each measure meeting its target?",
|
|
1128
|
+
use: "Use it for a few key measures held against targets and qualitative bands, such as latency against its objective.",
|
|
1129
|
+
avoid: "Use BarChart when there are no targets, and a table when readers need many exact values.",
|
|
1130
|
+
example: {
|
|
1131
|
+
chart: "BulletBar",
|
|
1132
|
+
props: {
|
|
1133
|
+
title: "p95 latency against objectives",
|
|
1134
|
+
description: "Synthetic. Bands mark good, acceptable and poor.",
|
|
1135
|
+
locale: "en-US",
|
|
1136
|
+
rows: [
|
|
1137
|
+
{
|
|
1138
|
+
id: "chat",
|
|
1139
|
+
label: "Chat",
|
|
1140
|
+
value: 620,
|
|
1141
|
+
target: 800
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
id: "embed",
|
|
1145
|
+
label: "Embeddings",
|
|
1146
|
+
value: 140,
|
|
1147
|
+
target: 120
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
id: "search",
|
|
1151
|
+
label: "Search",
|
|
1152
|
+
value: 410,
|
|
1153
|
+
target: 500
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
id: "batch",
|
|
1157
|
+
label: "Batch",
|
|
1158
|
+
value: 950,
|
|
1159
|
+
target: 1200
|
|
1160
|
+
}
|
|
1161
|
+
].map((e) => ({
|
|
1162
|
+
...e,
|
|
1163
|
+
ranges: [
|
|
1164
|
+
{
|
|
1165
|
+
upTo: e.target,
|
|
1166
|
+
label: "Good"
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
upTo: e.target * 1.25,
|
|
1170
|
+
label: "Acceptable"
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
upTo: 2e3,
|
|
1174
|
+
label: "Poor"
|
|
1175
|
+
}
|
|
1176
|
+
]
|
|
1177
|
+
})),
|
|
1178
|
+
value: {
|
|
1179
|
+
label: "p95 latency (ms)",
|
|
1180
|
+
domain: [0, 2e3],
|
|
1181
|
+
format: R.milliseconds
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
BarChart: {
|
|
1187
|
+
question: "How large is each amount, by category and series?",
|
|
1188
|
+
use: "Use it for amounts measured from zero across a few categories, grouped or stacked by series.",
|
|
1189
|
+
avoid: "Use DotPlot when the values do not start at zero, and LineChart when the categories are instants.",
|
|
1190
|
+
example: {
|
|
1191
|
+
chart: "BarChart",
|
|
1192
|
+
props: {
|
|
1193
|
+
title: "Tokens by operation",
|
|
1194
|
+
description: "Synthetic daily totals. Embeddings produce no output tokens.",
|
|
1195
|
+
locale: "en-US",
|
|
1196
|
+
categories: [
|
|
1197
|
+
{
|
|
1198
|
+
id: "chat",
|
|
1199
|
+
label: "Chat"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
id: "embed",
|
|
1203
|
+
label: "Embeddings"
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
id: "batch",
|
|
1207
|
+
label: "Batch"
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
id: "eval",
|
|
1211
|
+
label: "Evaluation"
|
|
1212
|
+
}
|
|
1213
|
+
],
|
|
1214
|
+
series: [{
|
|
1215
|
+
id: "input",
|
|
1216
|
+
label: "Input tokens",
|
|
1217
|
+
values: [
|
|
1218
|
+
42e6,
|
|
1219
|
+
184e5,
|
|
1220
|
+
312e5,
|
|
1221
|
+
91e5
|
|
1222
|
+
]
|
|
1223
|
+
}, {
|
|
1224
|
+
id: "output",
|
|
1225
|
+
label: "Output tokens",
|
|
1226
|
+
values: [
|
|
1227
|
+
273e5,
|
|
1228
|
+
0,
|
|
1229
|
+
228e5,
|
|
1230
|
+
64e5
|
|
1231
|
+
]
|
|
1232
|
+
}],
|
|
1233
|
+
valueLabel: "Tokens",
|
|
1234
|
+
valueFormat: {
|
|
1235
|
+
notation: "compact",
|
|
1236
|
+
maximumFractionDigits: 1
|
|
1237
|
+
},
|
|
1238
|
+
source: "Synthetic usage log"
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
BridgeChart: {
|
|
1243
|
+
question: "Which changes add up to the difference between two totals?",
|
|
1244
|
+
use: "Use it to explain a change from one total to another as a sequence of signed parts, such as cost by cause.",
|
|
1245
|
+
avoid: "Use BarChart when the parts are independent amounts, not steps from one total to the next.",
|
|
1246
|
+
example: {
|
|
1247
|
+
chart: "BridgeChart",
|
|
1248
|
+
props: {
|
|
1249
|
+
title: "Monthly inference cost, October to November",
|
|
1250
|
+
description: "Synthetic. Each bar is one cause of the change.",
|
|
1251
|
+
locale: "en-US",
|
|
1252
|
+
steps: [
|
|
1253
|
+
{
|
|
1254
|
+
id: "oct",
|
|
1255
|
+
label: "October",
|
|
1256
|
+
kind: "start",
|
|
1257
|
+
value: 84e3
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
id: "traffic",
|
|
1261
|
+
label: "More traffic",
|
|
1262
|
+
kind: "change",
|
|
1263
|
+
value: 21e3
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
id: "cache",
|
|
1267
|
+
label: "Prompt cache",
|
|
1268
|
+
kind: "change",
|
|
1269
|
+
value: -9500
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
id: "model",
|
|
1273
|
+
label: "Larger model",
|
|
1274
|
+
kind: "change",
|
|
1275
|
+
value: 12500
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
id: "spot",
|
|
1279
|
+
label: "Spot capacity",
|
|
1280
|
+
kind: "change",
|
|
1281
|
+
value: -6e3
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
id: "nov",
|
|
1285
|
+
label: "November",
|
|
1286
|
+
kind: "total"
|
|
1287
|
+
}
|
|
1288
|
+
],
|
|
1289
|
+
valueLabel: "Monthly cost (USD)",
|
|
1290
|
+
valueFormat: R.dollars,
|
|
1291
|
+
source: "Synthetic billing export"
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
},
|
|
1295
|
+
BreakdownBar: {
|
|
1296
|
+
question: "How does one total split into parts?",
|
|
1297
|
+
use: "Use it for a single total and a few named parts, such as where the time of a request went.",
|
|
1298
|
+
avoid: "Use Treemap for many parts, and BarChart to compare several totals.",
|
|
1299
|
+
example: {
|
|
1300
|
+
chart: "BreakdownBar",
|
|
1301
|
+
props: {
|
|
1302
|
+
title: "Where a request’s 840 ms went",
|
|
1303
|
+
description: "Synthetic median request.",
|
|
1304
|
+
locale: "en-US",
|
|
1305
|
+
items: [
|
|
1306
|
+
{
|
|
1307
|
+
id: "queue",
|
|
1308
|
+
label: "Queue",
|
|
1309
|
+
value: 120
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
id: "prefill",
|
|
1313
|
+
label: "Prefill",
|
|
1314
|
+
value: 260
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
id: "decode",
|
|
1318
|
+
label: "Decode",
|
|
1319
|
+
value: 380
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
id: "network",
|
|
1323
|
+
label: "Network",
|
|
1324
|
+
value: 80
|
|
1325
|
+
}
|
|
1326
|
+
],
|
|
1327
|
+
total: 840,
|
|
1328
|
+
valueFormat: R.milliseconds
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
ScatterPlot: {
|
|
1333
|
+
question: "How do two measures of the same records relate?",
|
|
1334
|
+
use: "Use it for up to a thousand records with two measures each, such as cost and accuracy per model.",
|
|
1335
|
+
avoid: "Use EmbeddingMap or DensityMap for many thousands of points, and ScatterMatrix for more than two measures.",
|
|
1336
|
+
example: {
|
|
1337
|
+
chart: "ScatterPlot",
|
|
1338
|
+
props: {
|
|
1339
|
+
title: "Cost and accuracy per checkpoint",
|
|
1340
|
+
description: "Synthetic checkpoints of two model sizes.",
|
|
1341
|
+
locale: "en-US",
|
|
1342
|
+
points: k({ count: 24 }).map((e) => ({
|
|
1343
|
+
id: `ckpt-${e}`,
|
|
1344
|
+
label: `Checkpoint ${e + 1}`,
|
|
1345
|
+
x: .4 + e % 12 * .15 + (e >= 12 ? 1.6 : 0),
|
|
1346
|
+
y: F(.55 + Math.log1p(e % 12) * .06 + (e >= 12 ? .08 : 0)),
|
|
1347
|
+
tone: e >= 12 ? "series2" : "series1"
|
|
1348
|
+
})),
|
|
1349
|
+
x: {
|
|
1350
|
+
label: "Cost per 1k requests (USD)",
|
|
1351
|
+
format: {
|
|
1352
|
+
style: "currency",
|
|
1353
|
+
currency: "USD"
|
|
1354
|
+
}
|
|
1355
|
+
},
|
|
1356
|
+
y: {
|
|
1357
|
+
label: "Accuracy",
|
|
1358
|
+
domain: [.5, .9],
|
|
1359
|
+
format: R.percent
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
LineChart: {
|
|
1365
|
+
question: "How did a measure change over time?",
|
|
1366
|
+
use: "Use it for a few series over timestamps, such as latency per minute or requests per hour.",
|
|
1367
|
+
avoid: "Use CurveChart when the ordered variable is not time, and HorizonChart for dozens of series.",
|
|
1368
|
+
example: {
|
|
1369
|
+
chart: "LineChart",
|
|
1370
|
+
props: {
|
|
1371
|
+
title: "Request latency",
|
|
1372
|
+
description: "Synthetic p50 and p95 over one day, per hour.",
|
|
1373
|
+
locale: "en-US",
|
|
1374
|
+
series: [{
|
|
1375
|
+
id: "p50",
|
|
1376
|
+
label: "p50",
|
|
1377
|
+
points: M({
|
|
1378
|
+
start: L.start,
|
|
1379
|
+
step: L.hour,
|
|
1380
|
+
values: j({
|
|
1381
|
+
count: 24,
|
|
1382
|
+
base: 180,
|
|
1383
|
+
amplitude: 40,
|
|
1384
|
+
cycle: 24,
|
|
1385
|
+
phase: 18
|
|
1386
|
+
})
|
|
1387
|
+
})
|
|
1388
|
+
}, {
|
|
1389
|
+
id: "p95",
|
|
1390
|
+
label: "p95",
|
|
1391
|
+
points: M({
|
|
1392
|
+
start: L.start,
|
|
1393
|
+
step: L.hour,
|
|
1394
|
+
values: j({
|
|
1395
|
+
count: 24,
|
|
1396
|
+
base: 520,
|
|
1397
|
+
amplitude: 140,
|
|
1398
|
+
cycle: 24,
|
|
1399
|
+
phase: 18
|
|
1400
|
+
})
|
|
1401
|
+
})
|
|
1402
|
+
}],
|
|
1403
|
+
timestampUnit: "milliseconds",
|
|
1404
|
+
timeFormat: L.clock,
|
|
1405
|
+
valueLabel: "Latency (ms)",
|
|
1406
|
+
valueFormat: R.milliseconds,
|
|
1407
|
+
source: "Synthetic gateway metrics"
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
AreaChart: {
|
|
1412
|
+
question: "How did a total and its parts change over time?",
|
|
1413
|
+
use: "Use it stacked for parts that add up to a meaningful total over time, such as requests by region.",
|
|
1414
|
+
avoid: "Use LineChart when the series do not add up, or when readers compare series that are not at the bottom.",
|
|
1415
|
+
example: {
|
|
1416
|
+
chart: "AreaChart",
|
|
1417
|
+
props: {
|
|
1418
|
+
title: "Requests by region",
|
|
1419
|
+
description: "Synthetic requests per hour, stacked.",
|
|
1420
|
+
locale: "en-US",
|
|
1421
|
+
isStacked: !0,
|
|
1422
|
+
series: [
|
|
1423
|
+
{
|
|
1424
|
+
id: "us",
|
|
1425
|
+
label: "Americas",
|
|
1426
|
+
base: 4200,
|
|
1427
|
+
phase: 20
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
id: "eu",
|
|
1431
|
+
label: "Europe",
|
|
1432
|
+
base: 3100,
|
|
1433
|
+
phase: 14
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
id: "ap",
|
|
1437
|
+
label: "Asia Pacific",
|
|
1438
|
+
base: 2300,
|
|
1439
|
+
phase: 6
|
|
1440
|
+
}
|
|
1441
|
+
].map(({ id: e, label: t, base: n, phase: r }) => ({
|
|
1442
|
+
id: e,
|
|
1443
|
+
label: t,
|
|
1444
|
+
points: M({
|
|
1445
|
+
start: L.start,
|
|
1446
|
+
step: L.hour,
|
|
1447
|
+
values: j({
|
|
1448
|
+
count: 24,
|
|
1449
|
+
base: n,
|
|
1450
|
+
amplitude: n * .4,
|
|
1451
|
+
cycle: 24,
|
|
1452
|
+
phase: r
|
|
1453
|
+
})
|
|
1454
|
+
})
|
|
1455
|
+
})),
|
|
1456
|
+
timestampUnit: "milliseconds",
|
|
1457
|
+
timeFormat: L.clock,
|
|
1458
|
+
valueLabel: "Requests per hour",
|
|
1459
|
+
valueFormat: R.integer
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
},
|
|
1463
|
+
SmallMultiples: {
|
|
1464
|
+
question: "How do several related measures move together over the same time?",
|
|
1465
|
+
use: "Use it for a few measures with different units on one shared time axis, inspected together.",
|
|
1466
|
+
avoid: "Use LineChart when the series share one unit and belong on one plot.",
|
|
1467
|
+
example: {
|
|
1468
|
+
chart: "SmallMultiples",
|
|
1469
|
+
props: {
|
|
1470
|
+
locale: "en-US",
|
|
1471
|
+
timestampUnit: "milliseconds",
|
|
1472
|
+
timeFormat: L.clock,
|
|
1473
|
+
height: "compact",
|
|
1474
|
+
charts: [{
|
|
1475
|
+
id: "latency",
|
|
1476
|
+
title: "Latency",
|
|
1477
|
+
valueLabel: "Latency (ms)",
|
|
1478
|
+
valueFormat: R.milliseconds,
|
|
1479
|
+
series: [{
|
|
1480
|
+
id: "latency",
|
|
1481
|
+
label: "p95 latency",
|
|
1482
|
+
points: M({
|
|
1483
|
+
start: L.start,
|
|
1484
|
+
step: L.hour,
|
|
1485
|
+
values: j({
|
|
1486
|
+
count: 24,
|
|
1487
|
+
base: 520,
|
|
1488
|
+
amplitude: 140,
|
|
1489
|
+
cycle: 24,
|
|
1490
|
+
phase: 18
|
|
1491
|
+
})
|
|
1492
|
+
})
|
|
1493
|
+
}]
|
|
1494
|
+
}, {
|
|
1495
|
+
id: "errors",
|
|
1496
|
+
title: "Error rate",
|
|
1497
|
+
valueFormat: R.percent,
|
|
1498
|
+
series: [{
|
|
1499
|
+
id: "errors",
|
|
1500
|
+
label: "Error rate",
|
|
1501
|
+
points: M({
|
|
1502
|
+
start: L.start,
|
|
1503
|
+
step: L.hour,
|
|
1504
|
+
values: j({
|
|
1505
|
+
count: 24,
|
|
1506
|
+
base: .012,
|
|
1507
|
+
amplitude: .006,
|
|
1508
|
+
cycle: 12,
|
|
1509
|
+
phase: 3
|
|
1510
|
+
})
|
|
1511
|
+
})
|
|
1512
|
+
}]
|
|
1513
|
+
}]
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
},
|
|
1517
|
+
Sparkline: {
|
|
1518
|
+
question: "Which way is one measure trending, at a glance?",
|
|
1519
|
+
use: "Use it inline beside a number or in a dense summary, where a full chart would be too much.",
|
|
1520
|
+
avoid: "Use LineChart when readers need axes, exact values or several series.",
|
|
1521
|
+
example: {
|
|
1522
|
+
chart: "Sparkline",
|
|
1523
|
+
props: {
|
|
1524
|
+
title: "p95 latency, last 24 hours",
|
|
1525
|
+
summary: "Latency ranged from 380 to 660 milliseconds and ended at 470.",
|
|
1526
|
+
unit: "milliseconds",
|
|
1527
|
+
layout: "figure",
|
|
1528
|
+
timestampUnit: "milliseconds",
|
|
1529
|
+
series: {
|
|
1530
|
+
id: "latency",
|
|
1531
|
+
label: "p95 latency",
|
|
1532
|
+
points: M({
|
|
1533
|
+
start: L.start,
|
|
1534
|
+
step: L.hour,
|
|
1535
|
+
values: j({
|
|
1536
|
+
count: 24,
|
|
1537
|
+
base: 520,
|
|
1538
|
+
amplitude: 140,
|
|
1539
|
+
cycle: 24,
|
|
1540
|
+
phase: 18
|
|
1541
|
+
})
|
|
1542
|
+
})
|
|
1543
|
+
},
|
|
1544
|
+
valueDomain: [0, 800],
|
|
1545
|
+
markedPoints: [
|
|
1546
|
+
"minimum",
|
|
1547
|
+
"maximum",
|
|
1548
|
+
"last"
|
|
1549
|
+
]
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
},
|
|
1553
|
+
Histogram: {
|
|
1554
|
+
question: "How are the values of one measure distributed?",
|
|
1555
|
+
use: "Use it for the shape of one distribution from prepared bins, such as response lengths or latencies.",
|
|
1556
|
+
avoid: "Use ECDF to read percentiles exactly, and BoxPlot or ViolinPlot to compare several groups.",
|
|
1557
|
+
example: {
|
|
1558
|
+
chart: "Histogram",
|
|
1559
|
+
props: {
|
|
1560
|
+
title: "Response length",
|
|
1561
|
+
description: "Synthetic: 5,000 responses in bins of 50 tokens.",
|
|
1562
|
+
locale: "en-US",
|
|
1563
|
+
bins: N({
|
|
1564
|
+
center: 320,
|
|
1565
|
+
width: 110,
|
|
1566
|
+
from: 25,
|
|
1567
|
+
to: 775,
|
|
1568
|
+
count: 16
|
|
1569
|
+
}).map(({ value: e, density: t }) => ({
|
|
1570
|
+
id: `bin-${e - 25}`,
|
|
1571
|
+
label: `${e - 25}–${e + 25} tokens`,
|
|
1572
|
+
lowerBound: e - 25,
|
|
1573
|
+
upperBound: e + 25,
|
|
1574
|
+
count: Math.round(t * 5e3 * 50)
|
|
1575
|
+
})),
|
|
1576
|
+
value: {
|
|
1577
|
+
label: "Response length (tokens)",
|
|
1578
|
+
format: R.integer
|
|
1579
|
+
},
|
|
1580
|
+
count: {
|
|
1581
|
+
label: "Responses",
|
|
1582
|
+
format: R.integer
|
|
1583
|
+
},
|
|
1584
|
+
transforms: ["Binned in steps of 50 tokens"]
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
ECDF: {
|
|
1589
|
+
question: "What share of values falls below a given level?",
|
|
1590
|
+
use: "Use it to read percentiles and compare tails exactly, such as the share of requests under a latency objective.",
|
|
1591
|
+
avoid: "Use Histogram when the shape of the distribution matters more than its percentiles.",
|
|
1592
|
+
example: {
|
|
1593
|
+
chart: "ECDF",
|
|
1594
|
+
props: {
|
|
1595
|
+
title: "Request latency distribution",
|
|
1596
|
+
description: "Synthetic: share of 40 sampled requests at or below each latency.",
|
|
1597
|
+
locale: "en-US",
|
|
1598
|
+
points: k({ count: 40 }).map((e) => ({
|
|
1599
|
+
id: `r${e}`,
|
|
1600
|
+
value: Math.round(120 + 30 * Math.tan(((e + .5) / 40 - .5) * 2.6) + e * 6),
|
|
1601
|
+
probability: F((e + 1) / 40)
|
|
1602
|
+
})),
|
|
1603
|
+
value: {
|
|
1604
|
+
label: "Latency (ms)",
|
|
1605
|
+
format: R.milliseconds
|
|
1606
|
+
},
|
|
1607
|
+
probability: {
|
|
1608
|
+
label: "Share of requests",
|
|
1609
|
+
domain: [0, 1],
|
|
1610
|
+
format: R.percent
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
IntervalPlot: {
|
|
1616
|
+
question: "What is each estimate, and how uncertain is it?",
|
|
1617
|
+
use: "Use it for estimates with confidence or credible intervals, such as an effect size per benchmark.",
|
|
1618
|
+
avoid: "Use DotPlot to compare several series per row, and BoxPlot to show the spread of raw values.",
|
|
1619
|
+
example: {
|
|
1620
|
+
chart: "IntervalPlot",
|
|
1621
|
+
props: {
|
|
1622
|
+
title: "Effect of the new prompt, by benchmark",
|
|
1623
|
+
description: "Synthetic difference in accuracy with 95% bootstrap intervals.",
|
|
1624
|
+
locale: "en-US",
|
|
1625
|
+
items: B.map((e, t) => ({
|
|
1626
|
+
...e,
|
|
1627
|
+
lower: F(-.02 + t * .012 - .025),
|
|
1628
|
+
estimate: F(-.02 + t * .012),
|
|
1629
|
+
upper: F(-.02 + t * .012 + .025)
|
|
1630
|
+
})),
|
|
1631
|
+
value: {
|
|
1632
|
+
label: "Change in accuracy",
|
|
1633
|
+
domain: [-.06, .08],
|
|
1634
|
+
format: R.percent
|
|
1635
|
+
},
|
|
1636
|
+
intervalLabel: "95% interval"
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
RankedBars: {
|
|
1641
|
+
question: "Which items rank highest on one measure?",
|
|
1642
|
+
use: "Use it for a sorted top list, such as the features or prompts with the largest effect.",
|
|
1643
|
+
avoid: "Use BarChart when the categories have a natural order, and DotPlot when values do not start at zero.",
|
|
1644
|
+
example: {
|
|
1645
|
+
chart: "RankedBars",
|
|
1646
|
+
props: {
|
|
1647
|
+
title: "Most frequent failure causes",
|
|
1648
|
+
description: "Synthetic counts from 1,200 failed evaluation items.",
|
|
1649
|
+
locale: "en-US",
|
|
1650
|
+
items: [
|
|
1651
|
+
{
|
|
1652
|
+
id: "format",
|
|
1653
|
+
label: "Wrong output format",
|
|
1654
|
+
value: 412
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
id: "math",
|
|
1658
|
+
label: "Arithmetic slip",
|
|
1659
|
+
value: 287
|
|
1660
|
+
},
|
|
1661
|
+
{
|
|
1662
|
+
id: "refusal",
|
|
1663
|
+
label: "Unneeded refusal",
|
|
1664
|
+
value: 196
|
|
1665
|
+
},
|
|
1666
|
+
{
|
|
1667
|
+
id: "halluc",
|
|
1668
|
+
label: "Unsupported claim",
|
|
1669
|
+
value: 171
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
id: "truncate",
|
|
1673
|
+
label: "Truncated answer",
|
|
1674
|
+
value: 134
|
|
1675
|
+
}
|
|
1676
|
+
].map((e, t) => ({
|
|
1677
|
+
...e,
|
|
1678
|
+
rank: `${t + 1}`
|
|
1679
|
+
})),
|
|
1680
|
+
value: {
|
|
1681
|
+
label: "Failed items",
|
|
1682
|
+
format: R.integer
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
},
|
|
1687
|
+
BoxPlot: {
|
|
1688
|
+
question: "How do the distributions of several groups compare?",
|
|
1689
|
+
use: "Use it for prepared quartiles of a handful of groups, such as latency per region, with outliers marked.",
|
|
1690
|
+
avoid: "Use ViolinPlot when the shape matters, and StripPlot when there are few enough values to show each.",
|
|
1691
|
+
example: {
|
|
1692
|
+
chart: "BoxPlot",
|
|
1693
|
+
props: {
|
|
1694
|
+
title: "Latency by region",
|
|
1695
|
+
description: "Synthetic quartiles of one day of requests. Whiskers reach 1.5 times the interquartile range.",
|
|
1696
|
+
locale: "en-US",
|
|
1697
|
+
groups: [
|
|
1698
|
+
{
|
|
1699
|
+
id: "us",
|
|
1700
|
+
label: "Americas",
|
|
1701
|
+
low: 90,
|
|
1702
|
+
q1: 160,
|
|
1703
|
+
median: 210,
|
|
1704
|
+
q3: 290,
|
|
1705
|
+
high: 470,
|
|
1706
|
+
outliers: [620, 710]
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
id: "eu",
|
|
1710
|
+
label: "Europe",
|
|
1711
|
+
low: 110,
|
|
1712
|
+
q1: 180,
|
|
1713
|
+
median: 240,
|
|
1714
|
+
q3: 320,
|
|
1715
|
+
high: 520,
|
|
1716
|
+
outliers: [680]
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
id: "ap",
|
|
1720
|
+
label: "Asia Pacific",
|
|
1721
|
+
low: 140,
|
|
1722
|
+
q1: 230,
|
|
1723
|
+
median: 300,
|
|
1724
|
+
q3: 410,
|
|
1725
|
+
high: 650,
|
|
1726
|
+
outliers: [
|
|
1727
|
+
780,
|
|
1728
|
+
820,
|
|
1729
|
+
905
|
|
1730
|
+
]
|
|
1731
|
+
}
|
|
1732
|
+
],
|
|
1733
|
+
value: {
|
|
1734
|
+
label: "Latency (ms)",
|
|
1735
|
+
format: R.milliseconds
|
|
1736
|
+
},
|
|
1737
|
+
whiskerLabel: "1.5 × IQR",
|
|
1738
|
+
transforms: ["Quartiles of each region’s requests"]
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
},
|
|
1742
|
+
ViolinPlot: {
|
|
1743
|
+
question: "How does the shape of a distribution differ between groups?",
|
|
1744
|
+
use: "Use it for prepared densities of a few groups when bimodality or skew matters, such as reward per policy.",
|
|
1745
|
+
avoid: "Use BoxPlot when quartiles are enough, and Ridgeline for many groups in order.",
|
|
1746
|
+
example: {
|
|
1747
|
+
chart: "ViolinPlot",
|
|
1748
|
+
props: {
|
|
1749
|
+
title: "Reward by policy",
|
|
1750
|
+
description: "Synthetic kernel density of episode reward.",
|
|
1751
|
+
locale: "en-US",
|
|
1752
|
+
groups: [
|
|
1753
|
+
{
|
|
1754
|
+
id: "base",
|
|
1755
|
+
label: "Base",
|
|
1756
|
+
center: .2,
|
|
1757
|
+
width: .18
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
id: "ppo",
|
|
1761
|
+
label: "PPO",
|
|
1762
|
+
center: .45,
|
|
1763
|
+
width: .14
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
id: "dpo",
|
|
1767
|
+
label: "DPO",
|
|
1768
|
+
center: .52,
|
|
1769
|
+
width: .2
|
|
1770
|
+
}
|
|
1771
|
+
].map(({ id: e, label: t, center: n, width: r }) => ({
|
|
1772
|
+
id: e,
|
|
1773
|
+
label: t,
|
|
1774
|
+
density: N({
|
|
1775
|
+
center: n,
|
|
1776
|
+
width: r,
|
|
1777
|
+
from: -.4,
|
|
1778
|
+
to: 1.2,
|
|
1779
|
+
count: 33
|
|
1780
|
+
}),
|
|
1781
|
+
median: n,
|
|
1782
|
+
q1: n - r * .67,
|
|
1783
|
+
q3: n + r * .67
|
|
1784
|
+
})),
|
|
1785
|
+
value: {
|
|
1786
|
+
label: "Episode reward",
|
|
1787
|
+
domain: [-.4, 1.2],
|
|
1788
|
+
format: R.decimal
|
|
1789
|
+
},
|
|
1790
|
+
densityLabel: "estimated density",
|
|
1791
|
+
transforms: ["Kernel density, bandwidth 0.05"]
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
},
|
|
1795
|
+
StripPlot: {
|
|
1796
|
+
question: "Where does every single value of each group fall?",
|
|
1797
|
+
use: "Use it when there are few enough values to show each one, such as the score of every seed.",
|
|
1798
|
+
avoid: "Use BoxPlot or ViolinPlot when there are hundreds of values per group.",
|
|
1799
|
+
example: {
|
|
1800
|
+
chart: "StripPlot",
|
|
1801
|
+
props: {
|
|
1802
|
+
title: "Score per seed",
|
|
1803
|
+
description: "Synthetic scores of eight seeds per configuration; the rule marks the median.",
|
|
1804
|
+
locale: "en-US",
|
|
1805
|
+
groups: [
|
|
1806
|
+
{
|
|
1807
|
+
id: "a",
|
|
1808
|
+
label: "Config A"
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
id: "b",
|
|
1812
|
+
label: "Config B"
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
id: "c",
|
|
1816
|
+
label: "Config C"
|
|
1817
|
+
}
|
|
1818
|
+
],
|
|
1819
|
+
points: [
|
|
1820
|
+
"a",
|
|
1821
|
+
"b",
|
|
1822
|
+
"c"
|
|
1823
|
+
].flatMap((e, t) => k({ count: 8 }).map((n) => ({
|
|
1824
|
+
id: `${e}-${n}`,
|
|
1825
|
+
groupId: e,
|
|
1826
|
+
label: `Seed ${n}`,
|
|
1827
|
+
value: F(.6 + t * .05 + Math.sin(n * 2.3 + t) * .03)
|
|
1828
|
+
}))),
|
|
1829
|
+
summary: {
|
|
1830
|
+
a: .6,
|
|
1831
|
+
b: .65,
|
|
1832
|
+
c: .7
|
|
1833
|
+
},
|
|
1834
|
+
summaryLabel: "Median",
|
|
1835
|
+
value: {
|
|
1836
|
+
label: "Score",
|
|
1837
|
+
domain: [.5, .8],
|
|
1838
|
+
format: R.percent
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
},
|
|
1843
|
+
Ridgeline: {
|
|
1844
|
+
question: "How does a distribution shift across many ordered groups?",
|
|
1845
|
+
use: "Use it for prepared densities of many groups in order, such as activation values per layer.",
|
|
1846
|
+
avoid: "Use ViolinPlot for a few unordered groups, and Histogram for one distribution.",
|
|
1847
|
+
example: {
|
|
1848
|
+
chart: "Ridgeline",
|
|
1849
|
+
props: {
|
|
1850
|
+
title: "Activation norm by layer",
|
|
1851
|
+
description: "Synthetic kernel densities for six layers.",
|
|
1852
|
+
locale: "en-US",
|
|
1853
|
+
rows: k({ count: 6 }).map((e) => ({
|
|
1854
|
+
id: `layer-${e * 4}`,
|
|
1855
|
+
label: `Layer ${e * 4}`,
|
|
1856
|
+
density: N({
|
|
1857
|
+
center: 2 + e * .9,
|
|
1858
|
+
width: .6 + e * .12,
|
|
1859
|
+
from: 0,
|
|
1860
|
+
to: 10,
|
|
1861
|
+
count: 41
|
|
1862
|
+
})
|
|
1863
|
+
})),
|
|
1864
|
+
value: {
|
|
1865
|
+
label: "Activation norm",
|
|
1866
|
+
domain: [0, 10],
|
|
1867
|
+
format: R.decimal
|
|
1868
|
+
},
|
|
1869
|
+
densityLabel: "estimated density"
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
},
|
|
1873
|
+
Matrix: {
|
|
1874
|
+
question: "What is the value for every pair of two categories?",
|
|
1875
|
+
use: "Use it for a measured value per row and column, such as accuracy per model and benchmark, with missing cells marked.",
|
|
1876
|
+
avoid: "Use ConfusionMatrix, CorrelationMatrix or AttentionMatrix for those specific matrices, and DotPlot for few rows.",
|
|
1877
|
+
example: {
|
|
1878
|
+
chart: "Matrix",
|
|
1879
|
+
props: {
|
|
1880
|
+
title: "Accuracy by model and benchmark",
|
|
1881
|
+
description: "Synthetic. One run was not evaluated.",
|
|
1882
|
+
locale: "en-US",
|
|
1883
|
+
rows: [
|
|
1884
|
+
"Small",
|
|
1885
|
+
"Medium",
|
|
1886
|
+
"Large"
|
|
1887
|
+
].map((e) => ({
|
|
1888
|
+
id: e.toLowerCase(),
|
|
1889
|
+
label: e
|
|
1890
|
+
})),
|
|
1891
|
+
columns: B,
|
|
1892
|
+
cells: [
|
|
1893
|
+
"small",
|
|
1894
|
+
"medium",
|
|
1895
|
+
"large"
|
|
1896
|
+
].flatMap((e, t) => B.map((n, r) => e === "medium" && n.id === "truthfulqa" ? {
|
|
1897
|
+
id: `${e}-${n.id}`,
|
|
1898
|
+
rowId: e,
|
|
1899
|
+
columnId: n.id,
|
|
1900
|
+
kind: "missing",
|
|
1901
|
+
reason: "Not evaluated"
|
|
1902
|
+
} : {
|
|
1903
|
+
id: `${e}-${n.id}`,
|
|
1904
|
+
rowId: e,
|
|
1905
|
+
columnId: n.id,
|
|
1906
|
+
kind: "value",
|
|
1907
|
+
value: F(.45 + t * .1 + r * .04)
|
|
1908
|
+
})),
|
|
1909
|
+
valueLabel: "Accuracy",
|
|
1910
|
+
valueFormat: R.percent,
|
|
1911
|
+
domain: [0, 1],
|
|
1912
|
+
palette: "sequential"
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
},
|
|
1916
|
+
TokenHeatmap: {
|
|
1917
|
+
question: "Which tokens of a text carry the most of a score?",
|
|
1918
|
+
use: "Use it to shade a passage by a per-token value, such as a feature’s activation or a token’s loss.",
|
|
1919
|
+
avoid: "Use TokenExamples for several passages, and TokenPredictions for the next-token distribution.",
|
|
1920
|
+
example: {
|
|
1921
|
+
chart: "TokenHeatmap",
|
|
1922
|
+
props: {
|
|
1923
|
+
title: "Per-token loss",
|
|
1924
|
+
description: "Synthetic loss of each token given the ones before it.",
|
|
1925
|
+
locale: "en-US",
|
|
1926
|
+
tokens: H.map((e, t) => ({
|
|
1927
|
+
...e,
|
|
1928
|
+
score: [
|
|
1929
|
+
3.1,
|
|
1930
|
+
4.2,
|
|
1931
|
+
2.8,
|
|
1932
|
+
.9,
|
|
1933
|
+
.4,
|
|
1934
|
+
1.7,
|
|
1935
|
+
3.6,
|
|
1936
|
+
1.2,
|
|
1937
|
+
.6,
|
|
1938
|
+
2.4
|
|
1939
|
+
][t] ?? null
|
|
1940
|
+
})),
|
|
1941
|
+
valueLabel: "Loss (nats)",
|
|
1942
|
+
valueFormat: R.decimal,
|
|
1943
|
+
domain: [0, 5],
|
|
1944
|
+
palette: "sequential"
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
},
|
|
1948
|
+
ConfusionMatrix: {
|
|
1949
|
+
question: "Which classes does a classifier confuse with which?",
|
|
1950
|
+
use: "Use it for counts of true against predicted classes, raw or normalized per true class.",
|
|
1951
|
+
avoid: "Use Matrix for any other value per pair, and BarChart for per-class accuracy alone.",
|
|
1952
|
+
example: {
|
|
1953
|
+
chart: "ConfusionMatrix",
|
|
1954
|
+
props: {
|
|
1955
|
+
title: "Toxicity classifier",
|
|
1956
|
+
description: "Synthetic counts on 1,000 held-out items, shown as a share of each true class.",
|
|
1957
|
+
locale: "en-US",
|
|
1958
|
+
classes: [
|
|
1959
|
+
{
|
|
1960
|
+
id: "safe",
|
|
1961
|
+
label: "Safe"
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
id: "borderline",
|
|
1965
|
+
label: "Borderline"
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
id: "toxic",
|
|
1969
|
+
label: "Toxic"
|
|
1970
|
+
}
|
|
1971
|
+
],
|
|
1972
|
+
counts: [
|
|
1973
|
+
[
|
|
1974
|
+
610,
|
|
1975
|
+
42,
|
|
1976
|
+
8
|
|
1977
|
+
],
|
|
1978
|
+
[
|
|
1979
|
+
55,
|
|
1980
|
+
118,
|
|
1981
|
+
27
|
|
1982
|
+
],
|
|
1983
|
+
[
|
|
1984
|
+
6,
|
|
1985
|
+
21,
|
|
1986
|
+
113
|
|
1987
|
+
]
|
|
1988
|
+
],
|
|
1989
|
+
normalize: "row"
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
},
|
|
1993
|
+
CorrelationMatrix: {
|
|
1994
|
+
question: "Which measures move together?",
|
|
1995
|
+
use: "Use it for prepared correlation coefficients between a few measures, such as benchmark scores across models.",
|
|
1996
|
+
avoid: "Use ScatterMatrix to see the points behind each coefficient.",
|
|
1997
|
+
example: {
|
|
1998
|
+
chart: "CorrelationMatrix",
|
|
1999
|
+
props: {
|
|
2000
|
+
title: "Benchmark correlation across 40 models",
|
|
2001
|
+
description: "Synthetic Pearson coefficients.",
|
|
2002
|
+
locale: "en-US",
|
|
2003
|
+
variables: B,
|
|
2004
|
+
coefficients: [
|
|
2005
|
+
[
|
|
2006
|
+
1,
|
|
2007
|
+
.82,
|
|
2008
|
+
.64,
|
|
2009
|
+
.77,
|
|
2010
|
+
.31
|
|
2011
|
+
],
|
|
2012
|
+
[
|
|
2013
|
+
.82,
|
|
2014
|
+
1,
|
|
2015
|
+
.58,
|
|
2016
|
+
.69,
|
|
2017
|
+
.22
|
|
2018
|
+
],
|
|
2019
|
+
[
|
|
2020
|
+
.64,
|
|
2021
|
+
.58,
|
|
2022
|
+
1,
|
|
2023
|
+
.51,
|
|
2024
|
+
.12
|
|
2025
|
+
],
|
|
2026
|
+
[
|
|
2027
|
+
.77,
|
|
2028
|
+
.69,
|
|
2029
|
+
.51,
|
|
2030
|
+
1,
|
|
2031
|
+
.35
|
|
2032
|
+
],
|
|
2033
|
+
[
|
|
2034
|
+
.31,
|
|
2035
|
+
.22,
|
|
2036
|
+
.12,
|
|
2037
|
+
.35,
|
|
2038
|
+
1
|
|
2039
|
+
]
|
|
2040
|
+
],
|
|
2041
|
+
triangle: "lower",
|
|
2042
|
+
transforms: ["Pearson correlation of scores"]
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
},
|
|
2046
|
+
AttentionMatrix: {
|
|
2047
|
+
question: "Which earlier tokens does each token attend to?",
|
|
2048
|
+
use: "Use it for one head’s attention weights over a short sequence, with the causal mask shown.",
|
|
2049
|
+
avoid: "Use TokenLinks to read the strongest links as lines between two rows of the text.",
|
|
2050
|
+
example: {
|
|
2051
|
+
chart: "AttentionMatrix",
|
|
2052
|
+
props: {
|
|
2053
|
+
title: "Layer 5, head 3 attention",
|
|
2054
|
+
description: "Synthetic weights of a previous-token head.",
|
|
2055
|
+
locale: "en-US",
|
|
2056
|
+
sources: H.slice(0, 7),
|
|
2057
|
+
destinations: H.slice(0, 7),
|
|
2058
|
+
weights: k({ count: 7 }).map((e) => k({ count: 7 }).map((t) => t > e ? null : e === 0 ? 1 : F(t === e - 1 ? .7 : .3 / e))),
|
|
2059
|
+
mask: "causal"
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
},
|
|
2063
|
+
CalendarHeatmap: {
|
|
2064
|
+
question: "How does a daily measure vary by week and weekday?",
|
|
2065
|
+
use: "Use it for one value per day over weeks or months, such as daily evaluation runs or incidents.",
|
|
2066
|
+
avoid: "Use LineChart when the trend matters more than the weekly pattern.",
|
|
2067
|
+
example: {
|
|
2068
|
+
chart: "CalendarHeatmap",
|
|
2069
|
+
props: {
|
|
2070
|
+
title: "Evaluation runs per day",
|
|
2071
|
+
description: "Synthetic: fewer runs at weekends.",
|
|
2072
|
+
locale: "en-US",
|
|
2073
|
+
days: Ke({
|
|
2074
|
+
start: Date.UTC(2026, 8, 7),
|
|
2075
|
+
step: L.day,
|
|
2076
|
+
count: 70
|
|
2077
|
+
}).map((e, t) => ({
|
|
2078
|
+
date: e,
|
|
2079
|
+
value: t % 7 >= 5 ? 2 + t % 3 : 9 + Math.round(4 * Math.sin(t / 5))
|
|
2080
|
+
})),
|
|
2081
|
+
range: {
|
|
2082
|
+
from: "2026-09-07",
|
|
2083
|
+
to: "2026-11-15"
|
|
2084
|
+
},
|
|
2085
|
+
weekStartsOn: "monday",
|
|
2086
|
+
valueLabel: "Runs",
|
|
2087
|
+
valueFormat: R.integer
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
},
|
|
2091
|
+
RelationGraph: {
|
|
2092
|
+
question: "How are a few named things connected?",
|
|
2093
|
+
use: "Use it for a small graph whose positions the application lays out, such as services and their calls.",
|
|
2094
|
+
avoid: "Use FlowDiagram when links carry amounts, and TreeDiagram for a strict hierarchy.",
|
|
2095
|
+
example: {
|
|
2096
|
+
chart: "RelationGraph",
|
|
2097
|
+
props: {
|
|
2098
|
+
title: "Service dependencies",
|
|
2099
|
+
description: "Synthetic. Arrows point from caller to callee.",
|
|
2100
|
+
locale: "en-US",
|
|
2101
|
+
width: 464,
|
|
2102
|
+
height: 240,
|
|
2103
|
+
nodes: [
|
|
2104
|
+
{
|
|
2105
|
+
id: "gateway",
|
|
2106
|
+
label: "Gateway",
|
|
2107
|
+
x: 8,
|
|
2108
|
+
y: 96,
|
|
2109
|
+
width: 120,
|
|
2110
|
+
height: 48
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
id: "router",
|
|
2114
|
+
label: "Router",
|
|
2115
|
+
x: 172,
|
|
2116
|
+
y: 96,
|
|
2117
|
+
width: 120,
|
|
2118
|
+
height: 48
|
|
2119
|
+
},
|
|
2120
|
+
{
|
|
2121
|
+
id: "cache",
|
|
2122
|
+
label: "Prompt cache",
|
|
2123
|
+
x: 172,
|
|
2124
|
+
y: 8,
|
|
2125
|
+
width: 120,
|
|
2126
|
+
height: 48
|
|
2127
|
+
},
|
|
2128
|
+
{
|
|
2129
|
+
id: "model",
|
|
2130
|
+
label: "Model server",
|
|
2131
|
+
x: 336,
|
|
2132
|
+
y: 52,
|
|
2133
|
+
width: 120,
|
|
2134
|
+
height: 48
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
id: "billing",
|
|
2138
|
+
label: "Billing",
|
|
2139
|
+
x: 336,
|
|
2140
|
+
y: 160,
|
|
2141
|
+
width: 120,
|
|
2142
|
+
height: 48
|
|
2143
|
+
}
|
|
2144
|
+
],
|
|
2145
|
+
edges: [
|
|
2146
|
+
{
|
|
2147
|
+
id: "e1",
|
|
2148
|
+
sourceId: "gateway",
|
|
2149
|
+
targetId: "router",
|
|
2150
|
+
label: "routes",
|
|
2151
|
+
direction: "directed"
|
|
2152
|
+
},
|
|
2153
|
+
{
|
|
2154
|
+
id: "e2",
|
|
2155
|
+
sourceId: "router",
|
|
2156
|
+
targetId: "cache",
|
|
2157
|
+
label: "looks up",
|
|
2158
|
+
direction: "directed"
|
|
2159
|
+
},
|
|
2160
|
+
{
|
|
2161
|
+
id: "e3",
|
|
2162
|
+
sourceId: "router",
|
|
2163
|
+
targetId: "model",
|
|
2164
|
+
label: "calls",
|
|
2165
|
+
direction: "directed"
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
id: "e4",
|
|
2169
|
+
sourceId: "router",
|
|
2170
|
+
targetId: "billing",
|
|
2171
|
+
label: "records",
|
|
2172
|
+
direction: "directed"
|
|
2173
|
+
}
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
},
|
|
2178
|
+
FlowDiagram: {
|
|
2179
|
+
question: "Where does a quantity go between stages?",
|
|
2180
|
+
use: "Use it for amounts flowing between stages, such as requests from source through filter to outcome.",
|
|
2181
|
+
avoid: "Use BridgeChart for changes to one total, and RelationGraph when links carry no amount.",
|
|
2182
|
+
example: {
|
|
2183
|
+
chart: "FlowDiagram",
|
|
2184
|
+
props: {
|
|
2185
|
+
title: "Requests through the safety pipeline",
|
|
2186
|
+
description: "Synthetic counts for one day.",
|
|
2187
|
+
locale: "en-US",
|
|
2188
|
+
nodes: [
|
|
2189
|
+
{
|
|
2190
|
+
id: "api",
|
|
2191
|
+
label: "API"
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
id: "app",
|
|
2195
|
+
label: "App"
|
|
2196
|
+
},
|
|
2197
|
+
{
|
|
2198
|
+
id: "filter",
|
|
2199
|
+
label: "Safety filter"
|
|
2200
|
+
},
|
|
2201
|
+
{
|
|
2202
|
+
id: "served",
|
|
2203
|
+
label: "Served",
|
|
2204
|
+
tone: "positive"
|
|
2205
|
+
},
|
|
2206
|
+
{
|
|
2207
|
+
id: "blocked",
|
|
2208
|
+
label: "Blocked",
|
|
2209
|
+
tone: "negative"
|
|
2210
|
+
}
|
|
2211
|
+
],
|
|
2212
|
+
links: [
|
|
2213
|
+
{
|
|
2214
|
+
id: "api-filter",
|
|
2215
|
+
sourceId: "api",
|
|
2216
|
+
targetId: "filter",
|
|
2217
|
+
value: 62e3
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
id: "app-filter",
|
|
2221
|
+
sourceId: "app",
|
|
2222
|
+
targetId: "filter",
|
|
2223
|
+
value: 38e3
|
|
2224
|
+
},
|
|
2225
|
+
{
|
|
2226
|
+
id: "filter-served",
|
|
2227
|
+
sourceId: "filter",
|
|
2228
|
+
targetId: "served",
|
|
2229
|
+
value: 97400
|
|
2230
|
+
},
|
|
2231
|
+
{
|
|
2232
|
+
id: "filter-blocked",
|
|
2233
|
+
sourceId: "filter",
|
|
2234
|
+
targetId: "blocked",
|
|
2235
|
+
value: 2600
|
|
2236
|
+
}
|
|
2237
|
+
],
|
|
2238
|
+
valueFormat: R.integer
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
AttributionGraph: {
|
|
2243
|
+
question: "Which features carry a model’s answer from the prompt to the output?",
|
|
2244
|
+
use: "Use it for an attribution graph: tokens, features by layer and the output, with signed edge weights.",
|
|
2245
|
+
avoid: "Use FlowDiagram for amounts that are conserved between stages, and TokenLinks for token-to-token weights.",
|
|
2246
|
+
example: {
|
|
2247
|
+
chart: "AttributionGraph",
|
|
2248
|
+
props: {
|
|
2249
|
+
title: "Attribution for “The capital of France is” → “Paris”",
|
|
2250
|
+
description: "Synthetic graph. Edge weight is the direct effect on the target.",
|
|
2251
|
+
locale: "en-US",
|
|
2252
|
+
layers: [
|
|
2253
|
+
{
|
|
2254
|
+
id: "tokens",
|
|
2255
|
+
label: "Prompt"
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
id: "l4",
|
|
2259
|
+
label: "Layer 4"
|
|
2260
|
+
},
|
|
2261
|
+
{
|
|
2262
|
+
id: "l12",
|
|
2263
|
+
label: "Layer 12"
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
id: "out",
|
|
2267
|
+
label: "Output"
|
|
2268
|
+
}
|
|
2269
|
+
],
|
|
2270
|
+
nodes: [
|
|
2271
|
+
{
|
|
2272
|
+
id: "tok-france",
|
|
2273
|
+
layerId: "tokens",
|
|
2274
|
+
label: "France",
|
|
2275
|
+
kind: "token"
|
|
2276
|
+
},
|
|
2277
|
+
{
|
|
2278
|
+
id: "tok-capital",
|
|
2279
|
+
layerId: "tokens",
|
|
2280
|
+
label: "capital",
|
|
2281
|
+
kind: "token"
|
|
2282
|
+
},
|
|
2283
|
+
{
|
|
2284
|
+
id: "f-country",
|
|
2285
|
+
layerId: "l4",
|
|
2286
|
+
label: "Country names",
|
|
2287
|
+
kind: "feature"
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
id: "f-capital",
|
|
2291
|
+
layerId: "l4",
|
|
2292
|
+
label: "Capital-of relation",
|
|
2293
|
+
kind: "feature"
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
id: "f-paris",
|
|
2297
|
+
layerId: "l12",
|
|
2298
|
+
label: "Say “Paris”",
|
|
2299
|
+
kind: "feature"
|
|
2300
|
+
},
|
|
2301
|
+
{
|
|
2302
|
+
id: "err",
|
|
2303
|
+
layerId: "l12",
|
|
2304
|
+
label: "Error",
|
|
2305
|
+
kind: "error"
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
id: "paris",
|
|
2309
|
+
layerId: "out",
|
|
2310
|
+
label: "Paris",
|
|
2311
|
+
kind: "output",
|
|
2312
|
+
value: .91
|
|
2313
|
+
}
|
|
2314
|
+
],
|
|
2315
|
+
edges: [
|
|
2316
|
+
{
|
|
2317
|
+
id: "a",
|
|
2318
|
+
sourceId: "tok-france",
|
|
2319
|
+
targetId: "f-country",
|
|
2320
|
+
weight: .8
|
|
2321
|
+
},
|
|
2322
|
+
{
|
|
2323
|
+
id: "b",
|
|
2324
|
+
sourceId: "tok-capital",
|
|
2325
|
+
targetId: "f-capital",
|
|
2326
|
+
weight: .7
|
|
2327
|
+
},
|
|
2328
|
+
{
|
|
2329
|
+
id: "c",
|
|
2330
|
+
sourceId: "f-country",
|
|
2331
|
+
targetId: "f-paris",
|
|
2332
|
+
weight: .6
|
|
2333
|
+
},
|
|
2334
|
+
{
|
|
2335
|
+
id: "d",
|
|
2336
|
+
sourceId: "f-capital",
|
|
2337
|
+
targetId: "f-paris",
|
|
2338
|
+
weight: .5
|
|
2339
|
+
},
|
|
2340
|
+
{
|
|
2341
|
+
id: "e",
|
|
2342
|
+
sourceId: "f-paris",
|
|
2343
|
+
targetId: "paris",
|
|
2344
|
+
weight: .9
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
id: "f",
|
|
2348
|
+
sourceId: "err",
|
|
2349
|
+
targetId: "paris",
|
|
2350
|
+
weight: -.1
|
|
2351
|
+
}
|
|
2352
|
+
],
|
|
2353
|
+
weightLabel: "Direct effect",
|
|
2354
|
+
weightFormat: R.decimal,
|
|
2355
|
+
valueLabel: "Probability",
|
|
2356
|
+
valueFormat: R.percent
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
},
|
|
2360
|
+
TreeDiagram: {
|
|
2361
|
+
question: "How is a hierarchy structured?",
|
|
2362
|
+
use: "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.",
|
|
2363
|
+
avoid: "Use Treemap or Icicle when each node carries an amount readers should compare.",
|
|
2364
|
+
example: {
|
|
2365
|
+
chart: "TreeDiagram",
|
|
2366
|
+
props: {
|
|
2367
|
+
title: "Agent plan",
|
|
2368
|
+
description: "Synthetic task decomposition with step durations.",
|
|
2369
|
+
locale: "en-US",
|
|
2370
|
+
nodes: [
|
|
2371
|
+
{
|
|
2372
|
+
id: "task",
|
|
2373
|
+
parentId: null,
|
|
2374
|
+
label: "Fix the failing test",
|
|
2375
|
+
value: 412
|
|
2376
|
+
},
|
|
2377
|
+
{
|
|
2378
|
+
id: "read",
|
|
2379
|
+
parentId: "task",
|
|
2380
|
+
label: "Read the test",
|
|
2381
|
+
value: 38
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
id: "search",
|
|
2385
|
+
parentId: "task",
|
|
2386
|
+
label: "Search the code",
|
|
2387
|
+
value: 96
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
id: "edit",
|
|
2391
|
+
parentId: "task",
|
|
2392
|
+
label: "Edit the parser",
|
|
2393
|
+
value: 181
|
|
2394
|
+
},
|
|
2395
|
+
{
|
|
2396
|
+
id: "run",
|
|
2397
|
+
parentId: "task",
|
|
2398
|
+
label: "Run the tests",
|
|
2399
|
+
value: 97
|
|
2400
|
+
},
|
|
2401
|
+
{
|
|
2402
|
+
id: "grep",
|
|
2403
|
+
parentId: "search",
|
|
2404
|
+
label: "Grep for the symbol",
|
|
2405
|
+
value: 41
|
|
2406
|
+
},
|
|
2407
|
+
{
|
|
2408
|
+
id: "open",
|
|
2409
|
+
parentId: "search",
|
|
2410
|
+
label: "Open two files",
|
|
2411
|
+
value: 55
|
|
2412
|
+
}
|
|
2413
|
+
],
|
|
2414
|
+
valueLabel: "Duration (s)",
|
|
2415
|
+
valueFormat: R.integer
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
},
|
|
2419
|
+
Treemap: {
|
|
2420
|
+
question: "Which parts make up most of a total?",
|
|
2421
|
+
use: "Use it for many parts of one total where the large parts matter, such as spend by project.",
|
|
2422
|
+
avoid: "Use BreakdownBar for a few parts, Icicle for nested levels and RankedBars to compare parts exactly.",
|
|
2423
|
+
example: {
|
|
2424
|
+
chart: "Treemap",
|
|
2425
|
+
props: {
|
|
2426
|
+
title: "GPU hours by project",
|
|
2427
|
+
description: "Synthetic November usage.",
|
|
2428
|
+
locale: "en-US",
|
|
2429
|
+
items: [
|
|
2430
|
+
{
|
|
2431
|
+
id: "pretrain",
|
|
2432
|
+
label: "Pretraining",
|
|
2433
|
+
value: 18400
|
|
2434
|
+
},
|
|
2435
|
+
{
|
|
2436
|
+
id: "rl",
|
|
2437
|
+
label: "RL fine-tuning",
|
|
2438
|
+
value: 7200
|
|
2439
|
+
},
|
|
2440
|
+
{
|
|
2441
|
+
id: "evals",
|
|
2442
|
+
label: "Evaluations",
|
|
2443
|
+
value: 3100
|
|
2444
|
+
},
|
|
2445
|
+
{
|
|
2446
|
+
id: "interp",
|
|
2447
|
+
label: "Interpretability",
|
|
2448
|
+
value: 2400
|
|
2449
|
+
},
|
|
2450
|
+
{
|
|
2451
|
+
id: "serving",
|
|
2452
|
+
label: "Serving tests",
|
|
2453
|
+
value: 1500
|
|
2454
|
+
},
|
|
2455
|
+
{
|
|
2456
|
+
id: "misc",
|
|
2457
|
+
label: "Other",
|
|
2458
|
+
value: 600
|
|
2459
|
+
}
|
|
2460
|
+
],
|
|
2461
|
+
valueFormat: R.integer
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
Icicle: {
|
|
2466
|
+
question: "How does a total split through nested levels?",
|
|
2467
|
+
use: "Use it for a hierarchy whose nodes carry amounts, such as time spent per span of a trace.",
|
|
2468
|
+
avoid: "Use Treemap for one level of many parts, and TreeDiagram when there are no amounts.",
|
|
2469
|
+
example: {
|
|
2470
|
+
chart: "Icicle",
|
|
2471
|
+
props: {
|
|
2472
|
+
title: "Time per span of one request",
|
|
2473
|
+
description: "Synthetic trace.",
|
|
2474
|
+
locale: "en-US",
|
|
2475
|
+
nodes: [
|
|
2476
|
+
{
|
|
2477
|
+
id: "request",
|
|
2478
|
+
parentId: null,
|
|
2479
|
+
label: "Request",
|
|
2480
|
+
value: 840
|
|
2481
|
+
},
|
|
2482
|
+
{
|
|
2483
|
+
id: "auth",
|
|
2484
|
+
parentId: "request",
|
|
2485
|
+
label: "Auth",
|
|
2486
|
+
value: 40
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
id: "generate",
|
|
2490
|
+
parentId: "request",
|
|
2491
|
+
label: "Generate",
|
|
2492
|
+
value: 720
|
|
2493
|
+
},
|
|
2494
|
+
{
|
|
2495
|
+
id: "log",
|
|
2496
|
+
parentId: "request",
|
|
2497
|
+
label: "Log",
|
|
2498
|
+
value: 60
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
id: "prefill",
|
|
2502
|
+
parentId: "generate",
|
|
2503
|
+
label: "Prefill",
|
|
2504
|
+
value: 260
|
|
2505
|
+
},
|
|
2506
|
+
{
|
|
2507
|
+
id: "decode",
|
|
2508
|
+
parentId: "generate",
|
|
2509
|
+
label: "Decode",
|
|
2510
|
+
value: 440
|
|
2511
|
+
}
|
|
2512
|
+
],
|
|
2513
|
+
valueFormat: R.milliseconds
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
},
|
|
2517
|
+
Waterfall: {
|
|
2518
|
+
question: "When did each step of a request or run start and end?",
|
|
2519
|
+
use: "Use it for the recorded timing of many steps on one scale, with exact timing stated for each row.",
|
|
2520
|
+
avoid: "Use EventStrip for events in a few lanes over a long window, and BreakdownBar for totals per step.",
|
|
2521
|
+
example: {
|
|
2522
|
+
chart: "Waterfall",
|
|
2523
|
+
props: {
|
|
2524
|
+
title: "Steps of one agent turn",
|
|
2525
|
+
locale: "en-US",
|
|
2526
|
+
start: 0,
|
|
2527
|
+
end: 2400,
|
|
2528
|
+
rowLabel: "Step",
|
|
2529
|
+
summaryLabel: "Duration",
|
|
2530
|
+
offsetFormat: R.milliseconds,
|
|
2531
|
+
items: [
|
|
2532
|
+
{
|
|
2533
|
+
id: "plan",
|
|
2534
|
+
label: "Plan",
|
|
2535
|
+
detail: "Model call",
|
|
2536
|
+
summary: "420 ms",
|
|
2537
|
+
geometry: {
|
|
2538
|
+
kind: "interval",
|
|
2539
|
+
start: 0,
|
|
2540
|
+
end: 420
|
|
2541
|
+
}
|
|
2542
|
+
},
|
|
2543
|
+
{
|
|
2544
|
+
id: "search",
|
|
2545
|
+
label: "Search tool",
|
|
2546
|
+
detail: "Tool call",
|
|
2547
|
+
summary: "610 ms",
|
|
2548
|
+
geometry: {
|
|
2549
|
+
kind: "interval",
|
|
2550
|
+
start: 430,
|
|
2551
|
+
end: 1040
|
|
2552
|
+
}
|
|
2553
|
+
},
|
|
2554
|
+
{
|
|
2555
|
+
id: "read",
|
|
2556
|
+
label: "Read file",
|
|
2557
|
+
detail: "Tool call",
|
|
2558
|
+
summary: "180 ms",
|
|
2559
|
+
geometry: {
|
|
2560
|
+
kind: "interval",
|
|
2561
|
+
start: 450,
|
|
2562
|
+
end: 630
|
|
2563
|
+
}
|
|
2564
|
+
},
|
|
2565
|
+
{
|
|
2566
|
+
id: "answer",
|
|
2567
|
+
label: "Answer",
|
|
2568
|
+
detail: "Model call",
|
|
2569
|
+
summary: "1,150 ms",
|
|
2570
|
+
tone: "positive",
|
|
2571
|
+
geometry: {
|
|
2572
|
+
kind: "interval",
|
|
2573
|
+
start: 1100,
|
|
2574
|
+
end: 2250
|
|
2575
|
+
}
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
id: "feedback",
|
|
2579
|
+
label: "Feedback recorded",
|
|
2580
|
+
detail: "One instant",
|
|
2581
|
+
summary: "At 2,300 ms",
|
|
2582
|
+
geometry: {
|
|
2583
|
+
kind: "point",
|
|
2584
|
+
at: 2300,
|
|
2585
|
+
marker: "filled"
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
]
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
EventStrip: {
|
|
2593
|
+
question: "What happened when, across a few kinds of events?",
|
|
2594
|
+
use: "Use it for deploys, incidents, runs and alerts over hours or days, where overlaps between lanes matter.",
|
|
2595
|
+
avoid: "Use Waterfall for the steps of one request, and LineChart for a measured value over time.",
|
|
2596
|
+
example: {
|
|
2597
|
+
chart: "EventStrip",
|
|
2598
|
+
props: {
|
|
2599
|
+
title: "Production on 16 November",
|
|
2600
|
+
description: "Synthetic operations log.",
|
|
2601
|
+
locale: "en-US",
|
|
2602
|
+
lanes: [
|
|
2603
|
+
{
|
|
2604
|
+
id: "deploys",
|
|
2605
|
+
label: "Deploys"
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
id: "incidents",
|
|
2609
|
+
label: "Incidents",
|
|
2610
|
+
tone: "negative"
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
id: "evals",
|
|
2614
|
+
label: "Evaluation runs"
|
|
2615
|
+
}
|
|
2616
|
+
],
|
|
2617
|
+
events: [
|
|
2618
|
+
{
|
|
2619
|
+
id: "d1",
|
|
2620
|
+
laneId: "deploys",
|
|
2621
|
+
label: "api 4.12.0",
|
|
2622
|
+
start: L.start + 2 * L.hour
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
id: "d2",
|
|
2626
|
+
laneId: "deploys",
|
|
2627
|
+
label: "api 4.12.1",
|
|
2628
|
+
start: L.start + 10 * L.hour
|
|
2629
|
+
},
|
|
2630
|
+
{
|
|
2631
|
+
id: "i1",
|
|
2632
|
+
laneId: "incidents",
|
|
2633
|
+
label: "Elevated 5xx",
|
|
2634
|
+
start: L.start + 8 * L.hour,
|
|
2635
|
+
end: L.start + 10 * L.hour
|
|
2636
|
+
},
|
|
2637
|
+
{
|
|
2638
|
+
id: "e1",
|
|
2639
|
+
laneId: "evals",
|
|
2640
|
+
label: "Nightly suite",
|
|
2641
|
+
start: L.start + L.hour,
|
|
2642
|
+
end: L.start + 6 * L.hour
|
|
2643
|
+
},
|
|
2644
|
+
{
|
|
2645
|
+
id: "e2",
|
|
2646
|
+
laneId: "evals",
|
|
2647
|
+
label: "Safety sweep",
|
|
2648
|
+
start: L.start + 4 * L.hour,
|
|
2649
|
+
end: L.start + 9 * L.hour
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
id: "e3",
|
|
2653
|
+
laneId: "evals",
|
|
2654
|
+
label: "Long-context eval",
|
|
2655
|
+
start: L.start + 13 * L.hour,
|
|
2656
|
+
end: L.start + 21 * L.hour
|
|
2657
|
+
}
|
|
2658
|
+
],
|
|
2659
|
+
domain: [L.start, L.start + L.day],
|
|
2660
|
+
markers: [{
|
|
2661
|
+
id: "cut",
|
|
2662
|
+
label: "Release cut",
|
|
2663
|
+
at: L.start + 16 * L.hour
|
|
2664
|
+
}],
|
|
2665
|
+
timeFormat: L.clock
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
},
|
|
2669
|
+
ContourPlot: {
|
|
2670
|
+
question: "What does a value look like over two continuous inputs?",
|
|
2671
|
+
use: "Use it for a prepared grid over two inputs, such as loss over two hyperparameters, with an optimizer’s path.",
|
|
2672
|
+
avoid: "Use DensityMap for counts of points, and Matrix for a value per pair of categories.",
|
|
2673
|
+
example: {
|
|
2674
|
+
chart: "ContourPlot",
|
|
2675
|
+
props: {
|
|
2676
|
+
title: "Loss over learning rate and warmup",
|
|
2677
|
+
description: "Synthetic loss surface. The dot marks the best trial.",
|
|
2678
|
+
locale: "en-US",
|
|
2679
|
+
grid: {
|
|
2680
|
+
columns: 24,
|
|
2681
|
+
rows: 18,
|
|
2682
|
+
xDomain: [-5, -2],
|
|
2683
|
+
yDomain: [0, 4e3],
|
|
2684
|
+
values: P({
|
|
2685
|
+
columns: 24,
|
|
2686
|
+
rows: 18,
|
|
2687
|
+
peaks: [
|
|
2688
|
+
{
|
|
2689
|
+
x: 4,
|
|
2690
|
+
y: 3,
|
|
2691
|
+
width: 6,
|
|
2692
|
+
height: 1.2
|
|
2693
|
+
},
|
|
2694
|
+
{
|
|
2695
|
+
x: 20,
|
|
2696
|
+
y: 15,
|
|
2697
|
+
width: 7,
|
|
2698
|
+
height: 1.6
|
|
2699
|
+
},
|
|
2700
|
+
{
|
|
2701
|
+
x: 13,
|
|
2702
|
+
y: 9,
|
|
2703
|
+
width: 3,
|
|
2704
|
+
height: -.8
|
|
2705
|
+
}
|
|
2706
|
+
]
|
|
2707
|
+
}).map((e) => Math.round((2.4 + e) * 1e3) / 1e3)
|
|
2708
|
+
},
|
|
2709
|
+
levels: [
|
|
2710
|
+
1.8,
|
|
2711
|
+
2,
|
|
2712
|
+
2.2,
|
|
2713
|
+
2.4,
|
|
2714
|
+
2.6,
|
|
2715
|
+
2.8,
|
|
2716
|
+
3
|
|
2717
|
+
],
|
|
2718
|
+
x: {
|
|
2719
|
+
label: "log10 learning rate",
|
|
2720
|
+
format: R.decimal
|
|
2721
|
+
},
|
|
2722
|
+
y: {
|
|
2723
|
+
label: "Warmup steps",
|
|
2724
|
+
format: R.integer
|
|
2725
|
+
},
|
|
2726
|
+
value: {
|
|
2727
|
+
label: "Loss (nats)",
|
|
2728
|
+
format: R.decimal
|
|
2729
|
+
},
|
|
2730
|
+
markers: [{
|
|
2731
|
+
id: "best",
|
|
2732
|
+
label: "Best trial",
|
|
2733
|
+
x: -3.4,
|
|
2734
|
+
y: 2e3
|
|
2735
|
+
}]
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
},
|
|
2739
|
+
ScatterMatrix: {
|
|
2740
|
+
question: "How do several measures relate to each other, pair by pair?",
|
|
2741
|
+
use: "Use it for up to six measures of a few hundred records, such as cost, latency and accuracy per model.",
|
|
2742
|
+
avoid: "Use ScatterPlot for one pair, ParallelCoordinates for many measures, and CorrelationMatrix for coefficients alone.",
|
|
2743
|
+
example: {
|
|
2744
|
+
chart: "ScatterMatrix",
|
|
2745
|
+
props: {
|
|
2746
|
+
title: "Model measures",
|
|
2747
|
+
description: "Synthetic: 30 models in two families.",
|
|
2748
|
+
locale: "en-US",
|
|
2749
|
+
dimensions: [
|
|
2750
|
+
{
|
|
2751
|
+
id: "params",
|
|
2752
|
+
label: "Parameters (B)",
|
|
2753
|
+
format: R.integer,
|
|
2754
|
+
scale: "log"
|
|
2755
|
+
},
|
|
2756
|
+
{
|
|
2757
|
+
id: "latency",
|
|
2758
|
+
label: "Latency (ms)",
|
|
2759
|
+
format: R.integer
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
id: "accuracy",
|
|
2763
|
+
label: "Accuracy",
|
|
2764
|
+
format: R.percent
|
|
2765
|
+
}
|
|
2766
|
+
],
|
|
2767
|
+
groups: [{
|
|
2768
|
+
id: "dense",
|
|
2769
|
+
label: "Dense"
|
|
2770
|
+
}, {
|
|
2771
|
+
id: "moe",
|
|
2772
|
+
label: "Mixture of experts"
|
|
2773
|
+
}],
|
|
2774
|
+
rows: k({ count: 30 }).map((e) => {
|
|
2775
|
+
let t = 2 ** (1 + e % 15 * .5);
|
|
2776
|
+
return {
|
|
2777
|
+
id: `m${e}`,
|
|
2778
|
+
label: `Model ${e + 1}`,
|
|
2779
|
+
group: e < 15 ? "dense" : "moe",
|
|
2780
|
+
values: {
|
|
2781
|
+
params: Math.round(t),
|
|
2782
|
+
latency: Math.round((e < 15 ? 40 : 25) + t * (e < 15 ? 2.2 : .9)),
|
|
2783
|
+
accuracy: F(.4 + Math.log2(t) * .05 + e % 4 * .01)
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
2786
|
+
})
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
},
|
|
2790
|
+
ParallelCoordinates: {
|
|
2791
|
+
question: "Which records do well on many measures at once?",
|
|
2792
|
+
use: "Use it to filter records across many measures, such as hyperparameter trials by their settings and score.",
|
|
2793
|
+
avoid: "Use ScatterMatrix to see pairwise relations, and a table for exact values.",
|
|
2794
|
+
example: {
|
|
2795
|
+
chart: "ParallelCoordinates",
|
|
2796
|
+
props: {
|
|
2797
|
+
title: "Hyperparameter trials",
|
|
2798
|
+
description: "Synthetic: 24 trials of a tuning run.",
|
|
2799
|
+
locale: "en-US",
|
|
2800
|
+
dimensions: [
|
|
2801
|
+
{
|
|
2802
|
+
id: "lr",
|
|
2803
|
+
label: "Learning rate",
|
|
2804
|
+
format: { maximumSignificantDigits: 2 },
|
|
2805
|
+
scale: "log",
|
|
2806
|
+
domain: [1e-5, .01]
|
|
2807
|
+
},
|
|
2808
|
+
{
|
|
2809
|
+
id: "batch",
|
|
2810
|
+
label: "Batch size",
|
|
2811
|
+
format: R.integer,
|
|
2812
|
+
domain: [0, 1024]
|
|
2813
|
+
},
|
|
2814
|
+
{
|
|
2815
|
+
id: "dropout",
|
|
2816
|
+
label: "Dropout",
|
|
2817
|
+
format: R.decimal,
|
|
2818
|
+
domain: [0, .5]
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
id: "score",
|
|
2822
|
+
label: "Validation score",
|
|
2823
|
+
format: R.percent,
|
|
2824
|
+
domain: [.5, .9]
|
|
2825
|
+
}
|
|
2826
|
+
],
|
|
2827
|
+
rows: k({ count: 24 }).map((e) => ({
|
|
2828
|
+
id: `trial-${e}`,
|
|
2829
|
+
label: `Trial ${e + 1}`,
|
|
2830
|
+
values: {
|
|
2831
|
+
lr: 10 ** (-5 + e % 6 * .55),
|
|
2832
|
+
batch: 64 * (1 + e % 8),
|
|
2833
|
+
dropout: F(e * 7 % 10 * .05),
|
|
2834
|
+
score: F(.62 + .2 * Math.exp(-((e % 6 - 3) ** 2) / 3) - e * 7 % 10 * .006)
|
|
2835
|
+
}
|
|
2836
|
+
}))
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
},
|
|
2840
|
+
EmbeddingMap: {
|
|
2841
|
+
question: "How do many items cluster in a learned embedding space?",
|
|
2842
|
+
use: "Use it for thousands to a million projected points with groups and landmarks, drawn on canvas or WebGL.",
|
|
2843
|
+
avoid: "Use ScatterPlot when every point needs to be inspected by name, and DensityMap when only density matters.",
|
|
2844
|
+
example: {
|
|
2845
|
+
chart: "EmbeddingMap",
|
|
2846
|
+
props: {
|
|
2847
|
+
title: "Prompt embeddings",
|
|
2848
|
+
description: "Synthetic two-dimensional projection of 600 prompts in three topics.",
|
|
2849
|
+
locale: "en-US",
|
|
2850
|
+
points: {
|
|
2851
|
+
x: k({ count: 600 }).map((e) => O((e % 3 - 1) * 4 + Math.cos(e * 2.4) * 2.2 * Math.sqrt(e * 37 % 600 / 600))),
|
|
2852
|
+
y: k({ count: 600 }).map((e) => O((e % 3 == 1 ? 3 : -1) + Math.sin(e * 2.4) * 2.2 * Math.sqrt(e * 37 % 600 / 600))),
|
|
2853
|
+
group: k({ count: 600 }).map((e) => e % 3)
|
|
2854
|
+
},
|
|
2855
|
+
groups: [
|
|
2856
|
+
{
|
|
2857
|
+
id: "code",
|
|
2858
|
+
label: "Code"
|
|
2859
|
+
},
|
|
2860
|
+
{
|
|
2861
|
+
id: "math",
|
|
2862
|
+
label: "Math"
|
|
2863
|
+
},
|
|
2864
|
+
{
|
|
2865
|
+
id: "chat",
|
|
2866
|
+
label: "Chat"
|
|
2867
|
+
}
|
|
2868
|
+
],
|
|
2869
|
+
landmarks: [{
|
|
2870
|
+
id: "reference",
|
|
2871
|
+
label: "Reference prompt",
|
|
2872
|
+
x: 0,
|
|
2873
|
+
y: -4
|
|
2874
|
+
}],
|
|
2875
|
+
x: {
|
|
2876
|
+
label: "Component 1",
|
|
2877
|
+
domain: [-8, 8],
|
|
2878
|
+
format: R.decimal
|
|
2879
|
+
},
|
|
2880
|
+
y: {
|
|
2881
|
+
label: "Component 2",
|
|
2882
|
+
domain: [-5, 7],
|
|
2883
|
+
format: R.decimal
|
|
2884
|
+
},
|
|
2885
|
+
transforms: ["Projected with UMAP"]
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
},
|
|
2889
|
+
DensityMap: {
|
|
2890
|
+
question: "Where are points concentrated over two measures?",
|
|
2891
|
+
use: "Use it for prepared two-dimensional counts of very many points, such as prompt length against latency.",
|
|
2892
|
+
avoid: "Use ScatterPlot when there are few enough points to show each, and ContourPlot for a measured surface.",
|
|
2893
|
+
example: {
|
|
2894
|
+
chart: "DensityMap",
|
|
2895
|
+
props: {
|
|
2896
|
+
title: "Prompt length and latency",
|
|
2897
|
+
description: "Synthetic counts of 200,000 requests.",
|
|
2898
|
+
locale: "en-US",
|
|
2899
|
+
histogram: {
|
|
2900
|
+
columns: 32,
|
|
2901
|
+
rows: 20,
|
|
2902
|
+
xDomain: [0, 8e3],
|
|
2903
|
+
yDomain: [0, 2e3],
|
|
2904
|
+
counts: P({
|
|
2905
|
+
columns: 32,
|
|
2906
|
+
rows: 20,
|
|
2907
|
+
peaks: [{
|
|
2908
|
+
x: 5,
|
|
2909
|
+
y: 15,
|
|
2910
|
+
width: 3,
|
|
2911
|
+
height: 900
|
|
2912
|
+
}, {
|
|
2913
|
+
x: 18,
|
|
2914
|
+
y: 8,
|
|
2915
|
+
width: 5,
|
|
2916
|
+
height: 300
|
|
2917
|
+
}]
|
|
2918
|
+
}).map((e) => Math.round(e))
|
|
2919
|
+
},
|
|
2920
|
+
x: {
|
|
2921
|
+
label: "Prompt length (tokens)",
|
|
2922
|
+
format: R.integer
|
|
2923
|
+
},
|
|
2924
|
+
y: {
|
|
2925
|
+
label: "Latency (ms)",
|
|
2926
|
+
format: R.integer
|
|
2927
|
+
},
|
|
2928
|
+
count: {
|
|
2929
|
+
label: "Requests",
|
|
2930
|
+
format: R.integer
|
|
2931
|
+
},
|
|
2932
|
+
transforms: ["Binned into 32 × 20 cells"]
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
},
|
|
2936
|
+
TokenExamples: {
|
|
2937
|
+
question: "On which passages, and which tokens, does a feature fire?",
|
|
2938
|
+
use: "Use it for the top activating examples of a feature, each passage shaded by activation around its peak.",
|
|
2939
|
+
avoid: "Use TokenHeatmap for one passage, and TokenGrid to compare several values per token.",
|
|
2940
|
+
example: {
|
|
2941
|
+
chart: "TokenExamples",
|
|
2942
|
+
props: {
|
|
2943
|
+
title: "Feature 2,817: references to warmth",
|
|
2944
|
+
description: "Synthetic top activating examples.",
|
|
2945
|
+
locale: "en-US",
|
|
2946
|
+
examples: [{
|
|
2947
|
+
id: "ex1",
|
|
2948
|
+
label: "Top 1",
|
|
2949
|
+
tokens: V.map((e, t) => ({
|
|
2950
|
+
text: e,
|
|
2951
|
+
value: t === 9 ? 8.4 : t === 8 ? 1.1 : 0
|
|
2952
|
+
})),
|
|
2953
|
+
peakIndex: 9
|
|
2954
|
+
}, {
|
|
2955
|
+
id: "ex2",
|
|
2956
|
+
label: "Top 2",
|
|
2957
|
+
tokens: [
|
|
2958
|
+
" A",
|
|
2959
|
+
" cozy",
|
|
2960
|
+
" fire",
|
|
2961
|
+
" kept",
|
|
2962
|
+
" the",
|
|
2963
|
+
" room",
|
|
2964
|
+
" toasty"
|
|
2965
|
+
].map((e, t) => ({
|
|
2966
|
+
text: e,
|
|
2967
|
+
value: [
|
|
2968
|
+
0,
|
|
2969
|
+
3.2,
|
|
2970
|
+
2.6,
|
|
2971
|
+
0,
|
|
2972
|
+
0,
|
|
2973
|
+
.4,
|
|
2974
|
+
7.9
|
|
2975
|
+
][t] ?? 0
|
|
2976
|
+
})),
|
|
2977
|
+
peakIndex: 6
|
|
2978
|
+
}],
|
|
2979
|
+
valueLabel: "Activation",
|
|
2980
|
+
valueFormat: R.decimal,
|
|
2981
|
+
domain: [0, 9],
|
|
2982
|
+
palette: "sequential"
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
},
|
|
2986
|
+
TokenPredictions: {
|
|
2987
|
+
question: "Which tokens does the model expect next, and how did that change?",
|
|
2988
|
+
use: "Use it for the top next-token probabilities at one position, against a baseline such as before an intervention.",
|
|
2989
|
+
avoid: "Use RankedBars for ranked values that are not token probabilities.",
|
|
2990
|
+
example: {
|
|
2991
|
+
chart: "TokenPredictions",
|
|
2992
|
+
props: {
|
|
2993
|
+
title: "Next token after “The capital of France is”",
|
|
2994
|
+
description: "Synthetic probabilities with and without ablating feature 2,817.",
|
|
2995
|
+
locale: "en-US",
|
|
2996
|
+
predictions: [
|
|
2997
|
+
{
|
|
2998
|
+
id: "paris",
|
|
2999
|
+
token: " Paris",
|
|
3000
|
+
probability: .91,
|
|
3001
|
+
baseline: .42,
|
|
3002
|
+
isTarget: !0
|
|
3003
|
+
},
|
|
3004
|
+
{
|
|
3005
|
+
id: "lyon",
|
|
3006
|
+
token: " Lyon",
|
|
3007
|
+
probability: .03,
|
|
3008
|
+
baseline: .18
|
|
3009
|
+
},
|
|
3010
|
+
{
|
|
3011
|
+
id: "a",
|
|
3012
|
+
token: " a",
|
|
3013
|
+
probability: .02,
|
|
3014
|
+
baseline: .11
|
|
3015
|
+
},
|
|
3016
|
+
{
|
|
3017
|
+
id: "the",
|
|
3018
|
+
token: " the",
|
|
3019
|
+
probability: .01,
|
|
3020
|
+
baseline: .09
|
|
3021
|
+
}
|
|
3022
|
+
],
|
|
3023
|
+
valueLabel: "Probability",
|
|
3024
|
+
valueFormat: R.percent,
|
|
3025
|
+
baselineLabel: "Feature ablated"
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
},
|
|
3029
|
+
TokenGrid: {
|
|
3030
|
+
question: "How does a per-token value change across layers or conditions?",
|
|
3031
|
+
use: "Use it for one value per token and row, such as a logit-lens probability per layer.",
|
|
3032
|
+
avoid: "Use TokenHeatmap for a single row, and Matrix when the columns are not tokens.",
|
|
3033
|
+
example: {
|
|
3034
|
+
chart: "TokenGrid",
|
|
3035
|
+
props: {
|
|
3036
|
+
title: "Logit lens: probability of the next token",
|
|
3037
|
+
description: "Synthetic. Each row reads the residual stream at one layer.",
|
|
3038
|
+
locale: "en-US",
|
|
3039
|
+
columns: H.slice(0, 6).map(({ id: e, text: t }) => ({
|
|
3040
|
+
id: e,
|
|
3041
|
+
token: t
|
|
3042
|
+
})),
|
|
3043
|
+
rows: [
|
|
3044
|
+
0,
|
|
3045
|
+
4,
|
|
3046
|
+
8,
|
|
3047
|
+
12
|
|
3048
|
+
].map((e) => ({
|
|
3049
|
+
id: `l${e}`,
|
|
3050
|
+
label: `Layer ${e}`
|
|
3051
|
+
})),
|
|
3052
|
+
cells: [
|
|
3053
|
+
0,
|
|
3054
|
+
4,
|
|
3055
|
+
8,
|
|
3056
|
+
12
|
|
3057
|
+
].flatMap((e, t) => H.slice(0, 6).map(({ id: n }, r) => ({
|
|
3058
|
+
rowId: `l${e}`,
|
|
3059
|
+
columnId: n,
|
|
3060
|
+
token: V[r + 1] ?? null,
|
|
3061
|
+
value: F(Math.min(1, .05 + t * .22 + r % 3 * .05))
|
|
3062
|
+
}))),
|
|
3063
|
+
valueLabel: "Probability",
|
|
3064
|
+
valueFormat: R.percent,
|
|
3065
|
+
domain: [0, 1],
|
|
3066
|
+
palette: "sequential"
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
},
|
|
3070
|
+
TokenLinks: {
|
|
3071
|
+
question: "Which tokens most influence which later tokens?",
|
|
3072
|
+
use: "Use it for the strongest token-to-token weights, such as attention or attribution, drawn as lines between two rows of the text.",
|
|
3073
|
+
avoid: "Use AttentionMatrix to see every weight of a head.",
|
|
3074
|
+
example: {
|
|
3075
|
+
chart: "TokenLinks",
|
|
3076
|
+
props: {
|
|
3077
|
+
title: "Strongest attention links, layer 5",
|
|
3078
|
+
description: "Synthetic weights above 0.2.",
|
|
3079
|
+
locale: "en-US",
|
|
3080
|
+
tokens: H.map(({ id: e, text: t }) => ({
|
|
3081
|
+
id: e,
|
|
3082
|
+
text: t
|
|
3083
|
+
})),
|
|
3084
|
+
links: [
|
|
3085
|
+
{
|
|
3086
|
+
sourceId: "t1",
|
|
3087
|
+
destinationId: "t7",
|
|
3088
|
+
weight: .72
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
sourceId: "t5",
|
|
3092
|
+
destinationId: "t9",
|
|
3093
|
+
weight: .41
|
|
3094
|
+
},
|
|
3095
|
+
{
|
|
3096
|
+
sourceId: "t2",
|
|
3097
|
+
destinationId: "t3",
|
|
3098
|
+
weight: .33
|
|
3099
|
+
},
|
|
3100
|
+
{
|
|
3101
|
+
sourceId: "t0",
|
|
3102
|
+
destinationId: "t4",
|
|
3103
|
+
weight: .24
|
|
3104
|
+
}
|
|
3105
|
+
],
|
|
3106
|
+
weightLabel: "Attention weight",
|
|
3107
|
+
valueFormat: R.decimal,
|
|
3108
|
+
domain: [0, 1],
|
|
3109
|
+
direction: "source-to-destination"
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
},
|
|
3113
|
+
ImageGrid: {
|
|
3114
|
+
question: "What do a set of images look like, with a value for each?",
|
|
3115
|
+
use: "Use it for a gallery of inputs or samples with a score each, such as a classifier’s most confident errors.",
|
|
3116
|
+
avoid: "Use ImageAtlas when the images sit at positions in a two-dimensional layout.",
|
|
3117
|
+
example: {
|
|
3118
|
+
chart: "ImageGrid",
|
|
3119
|
+
props: {
|
|
3120
|
+
title: "Most confident errors",
|
|
3121
|
+
description: "Synthetic pictures with the wrong class’s probability.",
|
|
3122
|
+
locale: "en-US",
|
|
3123
|
+
items: k({ count: 8 }).map((e) => ({
|
|
3124
|
+
id: `img-${e}`,
|
|
3125
|
+
src: I(e),
|
|
3126
|
+
alt: `Synthetic picture ${e + 1}: a white disc on a two-tone background`,
|
|
3127
|
+
label: `Sample ${e + 1}`,
|
|
3128
|
+
value: F(.98 - e * .04)
|
|
3129
|
+
})),
|
|
3130
|
+
valueLabel: "Wrong-class probability",
|
|
3131
|
+
valueFormat: R.percent,
|
|
3132
|
+
columns: 4
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
},
|
|
3136
|
+
AttributionOverlay: {
|
|
3137
|
+
question: "Which parts of an image drove the model’s output?",
|
|
3138
|
+
use: "Use it for a saliency or attribution grid laid over one image, with an adjustable opacity.",
|
|
3139
|
+
avoid: "Use ImageGrid to compare many images.",
|
|
3140
|
+
example: {
|
|
3141
|
+
chart: "AttributionOverlay",
|
|
3142
|
+
props: {
|
|
3143
|
+
title: "Attribution for the class “disc”",
|
|
3144
|
+
description: "Synthetic integrated gradients on a 12 × 12 grid.",
|
|
3145
|
+
locale: "en-US",
|
|
3146
|
+
image: {
|
|
3147
|
+
src: I(2),
|
|
3148
|
+
alt: "Synthetic picture: a white disc on a two-tone background",
|
|
3149
|
+
width: 96,
|
|
3150
|
+
height: 96
|
|
3151
|
+
},
|
|
3152
|
+
grid: {
|
|
3153
|
+
columns: 12,
|
|
3154
|
+
rows: 12,
|
|
3155
|
+
values: P({
|
|
3156
|
+
columns: 12,
|
|
3157
|
+
rows: 12,
|
|
3158
|
+
peaks: [{
|
|
3159
|
+
x: 5.5,
|
|
3160
|
+
y: 5.5,
|
|
3161
|
+
width: 2.2,
|
|
3162
|
+
height: 1
|
|
3163
|
+
}]
|
|
3164
|
+
})
|
|
3165
|
+
},
|
|
3166
|
+
valueLabel: "Attribution",
|
|
3167
|
+
valueFormat: R.decimal,
|
|
3168
|
+
domain: [0, 1],
|
|
3169
|
+
palette: "sequential"
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
},
|
|
3173
|
+
ImageAtlas: {
|
|
3174
|
+
question: "How do images arrange over a two-dimensional layout?",
|
|
3175
|
+
use: "Use it for images placed on a grid by a projection or two factors, such as a feature visualization atlas.",
|
|
3176
|
+
avoid: "Use ImageGrid for a plain gallery, and EmbeddingMap for many points without pictures.",
|
|
3177
|
+
example: {
|
|
3178
|
+
chart: "ImageAtlas",
|
|
3179
|
+
props: {
|
|
3180
|
+
title: "Activation atlas, layer 6",
|
|
3181
|
+
description: "Synthetic: average input per cell of a 4 × 3 layout.",
|
|
3182
|
+
locale: "en-US",
|
|
3183
|
+
columns: 4,
|
|
3184
|
+
rows: 3,
|
|
3185
|
+
cells: k({ count: 12 }).map((e) => ({
|
|
3186
|
+
id: `cell-${e}`,
|
|
3187
|
+
column: e % 4,
|
|
3188
|
+
row: Math.floor(e / 4),
|
|
3189
|
+
src: I(e),
|
|
3190
|
+
alt: `Synthetic picture for cell ${e + 1}`,
|
|
3191
|
+
value: F(.3 + e % 5 * .12)
|
|
3192
|
+
})),
|
|
3193
|
+
xLabel: "Component 1",
|
|
3194
|
+
yLabel: "Component 2",
|
|
3195
|
+
valueLabel: "Mean activation",
|
|
3196
|
+
valueFormat: R.decimal
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
}, Je = Object.values(qe).map((e) => ({
|
|
3201
|
+
...e,
|
|
3202
|
+
chart: e.example.chart,
|
|
3203
|
+
family: S[e.example.chart].family
|
|
3204
|
+
})), U = "A figure spec is an object with `chart` and `props`.", W = {
|
|
3205
|
+
count: 3,
|
|
3206
|
+
pair: 2,
|
|
3207
|
+
likenessMin: .5
|
|
3208
|
+
}, Ye = /* @__PURE__ */ new Set([
|
|
3209
|
+
"array",
|
|
3210
|
+
"object",
|
|
3211
|
+
"undefined",
|
|
3212
|
+
"other"
|
|
3213
|
+
]);
|
|
3214
|
+
function G(e) {
|
|
3215
|
+
if (e === null) return "null";
|
|
3216
|
+
if (Array.isArray(e)) return "array";
|
|
3217
|
+
switch (typeof e) {
|
|
3218
|
+
case "string": return "string";
|
|
3219
|
+
case "number": return "number";
|
|
3220
|
+
case "boolean": return "boolean";
|
|
3221
|
+
case "object": return "object";
|
|
3222
|
+
case "undefined": return "undefined";
|
|
3223
|
+
case "function": return "function";
|
|
3224
|
+
case "bigint":
|
|
3225
|
+
case "symbol": return "other";
|
|
3226
|
+
}
|
|
3227
|
+
return "other";
|
|
3228
|
+
}
|
|
3229
|
+
function K(e) {
|
|
3230
|
+
return `${Ye.has(e) ? "an" : "a"} ${e}`;
|
|
3231
|
+
}
|
|
3232
|
+
function Xe(e) {
|
|
3233
|
+
return Object.values(S).find((t) => t.chart === e);
|
|
3234
|
+
}
|
|
3235
|
+
function q(e) {
|
|
3236
|
+
return Array.from({ length: Math.max(e.length - 1, 0) }, (t, n) => e.slice(n, n + W.pair));
|
|
3237
|
+
}
|
|
3238
|
+
function Ze(e, t) {
|
|
3239
|
+
let n = q(e), r = new Set(q(t)), i = n.filter((e) => r.has(e)).length, a = n.length + r.size;
|
|
3240
|
+
return a === 0 ? 0 : W.pair * i / a;
|
|
3241
|
+
}
|
|
3242
|
+
function Qe(e) {
|
|
3243
|
+
let t = e.toLowerCase();
|
|
3244
|
+
return Object.values(S).map(({ chart: e }) => {
|
|
3245
|
+
let n = e.toLowerCase();
|
|
3246
|
+
return {
|
|
3247
|
+
chart: e,
|
|
3248
|
+
score: t.length > 0 && (n.includes(t) || t.includes(n)) ? 1 : Ze(t, n)
|
|
3249
|
+
};
|
|
3250
|
+
}).filter(({ score: e }) => e >= W.likenessMin).toSorted((e, t) => t.score - e.score).slice(0, W.count).map(({ chart: e }) => e);
|
|
3251
|
+
}
|
|
3252
|
+
function $e(e) {
|
|
3253
|
+
return Array.isArray(e) ? e : typeof e == "object" && e ? [...new Map(Object.entries(e)).values()] : [];
|
|
3254
|
+
}
|
|
3255
|
+
function* et(e) {
|
|
3256
|
+
let t = /* @__PURE__ */ new Set(), n = { values: [e] };
|
|
3257
|
+
for (; n.values.length > 0;) yield* n.values, n.values = n.values.flatMap((e) => typeof e != "object" || !e || t.has(e) ? [] : (t.add(e), $e(e)));
|
|
3258
|
+
}
|
|
3259
|
+
function tt(e, t, n) {
|
|
3260
|
+
if (typeof n != "object" || !n || Array.isArray(n)) return `${e} needs \`props\` as an object, not ${K(G(n))}.`;
|
|
3261
|
+
let r = new Map(Object.entries(n));
|
|
3262
|
+
for (let [n, i] of Object.entries(t)) {
|
|
3263
|
+
let t = G(r.get(n));
|
|
3264
|
+
if (t === "undefined") return `${e} needs the prop \`${n}\` (${K(i)}).`;
|
|
3265
|
+
if (t !== i) return `${e} needs \`${n}\` as ${K(i)}, not ${K(t)}.`;
|
|
3266
|
+
}
|
|
3267
|
+
if ([...et(n)].some((e) => typeof e == "function")) return "A figure spec is plain JSON, and its props hold a function. Pass callbacks to Figure beside the spec.";
|
|
3268
|
+
let i = r.get("locale");
|
|
3269
|
+
if (r.has("locale") && (typeof i != "string" || i.trim().length === 0)) return `${e} needs \`locale\` as a non-empty string, such as "en-US".`;
|
|
3270
|
+
}
|
|
3271
|
+
function nt(e) {
|
|
3272
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return U;
|
|
3273
|
+
let t = new Map(Object.entries(e)), n = t.get("chart");
|
|
3274
|
+
if (typeof n != "string") return "A figure spec needs `chart`, the name of a registered chart, as a string.";
|
|
3275
|
+
let r = Xe(n);
|
|
3276
|
+
if (r === void 0) {
|
|
3277
|
+
let e = Qe(n);
|
|
3278
|
+
return `"${n}" is not a registered chart.${e.length > 0 ? ` Did you mean ${e.join(", ")}?` : ""}`;
|
|
3279
|
+
}
|
|
3280
|
+
return tt(n, r.required, t.get("props"));
|
|
3281
|
+
}
|
|
3282
|
+
function rt(e, t) {
|
|
3283
|
+
return t === void 0 && typeof e == "object" && !!e;
|
|
3284
|
+
}
|
|
3285
|
+
function J(e) {
|
|
3286
|
+
let t = nt(e);
|
|
3287
|
+
return rt(e, t) ? {
|
|
3288
|
+
kind: "ok",
|
|
3289
|
+
spec: e
|
|
3290
|
+
} : {
|
|
3291
|
+
kind: "invalid",
|
|
3292
|
+
message: t ?? U
|
|
3293
|
+
};
|
|
3294
|
+
}
|
|
3295
|
+
// packages/charts/src/spec/figure.tsx
|
|
3296
|
+
var it = "Figure", at = "en-US";
|
|
3297
|
+
function Y(e, t) {
|
|
3298
|
+
let n = (typeof e == "object" && e ? new Map(Object.entries(e)) : null)?.get(t);
|
|
3299
|
+
return typeof n == "string" && n.trim().length > 0 ? n : void 0;
|
|
3300
|
+
}
|
|
3301
|
+
function ot({ spec: e, state: t }) {
|
|
3302
|
+
let { component: n, isSelectable: r } = S[e.chart], { selected: i, onSelectedChange: a, status: o } = t, s = r ? {
|
|
3303
|
+
...i === void 0 ? {} : { selected: i },
|
|
3304
|
+
onSelectedChange: a
|
|
3305
|
+
} : {}, c = {
|
|
3306
|
+
key: e.chart,
|
|
3307
|
+
...e.props,
|
|
3308
|
+
...s,
|
|
3309
|
+
...o === void 0 ? {} : { status: o }
|
|
3310
|
+
};
|
|
3311
|
+
return y(n, c);
|
|
3312
|
+
}
|
|
3313
|
+
function st({ spec: e, ...t }) {
|
|
3314
|
+
let n = J(e);
|
|
3315
|
+
if (n.kind === "invalid") {
|
|
3316
|
+
let t = (typeof e == "object" && e ? new Map(Object.entries(e)) : null)?.get("props");
|
|
3317
|
+
return /* @__PURE__ */ b(v, {
|
|
3318
|
+
title: Y(t, "title") ?? it,
|
|
3319
|
+
locale: Y(t, "locale") ?? at,
|
|
3320
|
+
message: n.message
|
|
3321
|
+
});
|
|
3322
|
+
}
|
|
3323
|
+
return /* @__PURE__ */ b(ot, {
|
|
3324
|
+
spec: n.spec,
|
|
3325
|
+
state: t
|
|
3326
|
+
});
|
|
3327
|
+
}
|
|
3328
|
+
// packages/charts/src/spec/figure-text.ts
|
|
3329
|
+
var ct = /* @__PURE__ */ new Set([
|
|
3330
|
+
"title",
|
|
3331
|
+
"description",
|
|
3332
|
+
"locale",
|
|
3333
|
+
"source",
|
|
3334
|
+
"coverage",
|
|
3335
|
+
"transforms",
|
|
3336
|
+
"report",
|
|
3337
|
+
"status",
|
|
3338
|
+
"emptyLabel",
|
|
3339
|
+
"selected",
|
|
3340
|
+
"highlighted",
|
|
3341
|
+
"pinned",
|
|
3342
|
+
"emphasizedCategoryIds"
|
|
3343
|
+
]), lt = /^[A-Z]{2,}$/u, ut = /[A-Z]+(?![a-z])|[A-Z][a-z]*|[a-z]+|\d+/gu, dt = /ies$/u, ft = /(?<!s)s$/u, X = /domain$/iu;
|
|
3344
|
+
function pt(e) {
|
|
3345
|
+
return (e.match(ut) ?? [e]).map((e) => lt.test(e) ? e : e.toLowerCase()).join(" ");
|
|
3346
|
+
}
|
|
3347
|
+
function Z(e) {
|
|
3348
|
+
return typeof e == "object" && e && !Array.isArray(e) ? [...new Map(Object.entries(e))] : [];
|
|
3349
|
+
}
|
|
3350
|
+
function mt(e, t) {
|
|
3351
|
+
if (Array.isArray(t)) {
|
|
3352
|
+
let n = t.flatMap((e) => Z(e).flatMap(([e, t]) => Array.isArray(t) && !X.test(e) ? [{
|
|
3353
|
+
noun: e,
|
|
3354
|
+
count: t.length
|
|
3355
|
+
}] : [])), r = [...new Set(n.map(({ noun: e }) => e))];
|
|
3356
|
+
return [{
|
|
3357
|
+
noun: e,
|
|
3358
|
+
count: t.length
|
|
3359
|
+
}, ...r.map((e) => ({
|
|
3360
|
+
noun: e,
|
|
3361
|
+
count: g(n.filter((t) => t.noun === e).map((e) => e.count))
|
|
3362
|
+
}))];
|
|
3363
|
+
}
|
|
3364
|
+
let n = Z(t).flatMap(([e, t]) => Array.isArray(t) && !X.test(e) ? [{
|
|
3365
|
+
noun: e,
|
|
3366
|
+
count: t.length
|
|
3367
|
+
}] : []), r = new Set(n.map(({ count: e }) => e)), [i] = r;
|
|
3368
|
+
return n.length > 1 && r.size === 1 && i !== void 0 ? [{
|
|
3369
|
+
noun: e,
|
|
3370
|
+
count: i
|
|
3371
|
+
}] : n;
|
|
3372
|
+
}
|
|
3373
|
+
function ht(e) {
|
|
3374
|
+
return e === "series" ? e : e.endsWith("ies") ? e.replace(dt, "y") : e.replace(ft, "");
|
|
3375
|
+
}
|
|
3376
|
+
function gt({ noun: e, count: t }, n) {
|
|
3377
|
+
return `${n === void 0 ? String(t) : Pe(t, n, {})} ${t === 1 ? ht(e) : e}`;
|
|
3378
|
+
}
|
|
3379
|
+
function Q(e) {
|
|
3380
|
+
return /[.!?]$/u.test(e) ? e : `${e}.`;
|
|
3381
|
+
}
|
|
3382
|
+
function $(e, t) {
|
|
3383
|
+
let n = e.get(t);
|
|
3384
|
+
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
3385
|
+
}
|
|
3386
|
+
function _t(e) {
|
|
3387
|
+
let t = new Map(Z(e)), n = t.get("shown"), r = t.get("total"), i = t.get("unit");
|
|
3388
|
+
return typeof n == "number" && typeof r == "number" && typeof i == "string" ? {
|
|
3389
|
+
shown: n,
|
|
3390
|
+
total: r,
|
|
3391
|
+
unit: i
|
|
3392
|
+
} : void 0;
|
|
3393
|
+
}
|
|
3394
|
+
function vt(e) {
|
|
3395
|
+
let t = new Map(Object.entries(e.props)), n = $(t, "locale"), r = $(t, "title"), i = $(t, "description"), a = $(t, "source"), o = _t(t.get("coverage")), s = t.get("transforms"), c = Array.isArray(s) ? s.filter((e) => typeof e == "string") : [], l = [...t].filter(([e]) => !ct.has(e) && !X.test(e)).flatMap(([e, t]) => mt(e, t)).map((e) => gt(e, n)), u = pt(e.chart), d = /^[aeiou]/iu.test(u) ? "An" : "A", f = r === void 0 ? `${d} ${u}` : `${d} ${u}, "${r}"`;
|
|
3396
|
+
return [
|
|
3397
|
+
l.length > 0 ? `${f}, with ${l.join(", ")}.` : `${f}.`,
|
|
3398
|
+
i === void 0 ? void 0 : Q(i),
|
|
3399
|
+
o === void 0 || n === void 0 ? void 0 : Q(_(o, n)),
|
|
3400
|
+
a === void 0 ? void 0 : Q(`Source: ${a}`),
|
|
3401
|
+
c.length > 0 ? Q(`Transforms: ${c.join("; ")}`) : void 0
|
|
3402
|
+
].filter((e) => e !== void 0).join(" ");
|
|
3403
|
+
}
|
|
3404
|
+
export { st as Figure, Je as chartGuide, vt as describeFigure, Re as figureCharts, J as validateFigureSpec };
|