AGENT SKILL

charts-and-figures

Choose, author, and troubleshoot Vizro charts, figures, tables, and visual-vocabulary patterns with Plotly/Vizro APIs.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
charts-and-figures
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Choose, author, and troubleshoot Vizro charts, figures, tables, and visual-vocabulary patterns with Plotly/Vizro APIs.
disable-model-invocation
true

03 SKILL.md 正文

Charts and Figures

Use this sub-skill when the task asks what chart to use, how to write a Vizro/Plotly figure, how to attach a figure/table to a dashboard, or how to debug visual output.

Route elsewhere when the task is mainly about:

  • Dashboard/page skeleton: ../core-dashboard-build/SKILL.md.
  • Filters/data/actions around a figure: ../core-components-data-actions/SKILL.md.
  • Deprecated AI chart-agent code: ../legacy-ai-chart-agent/SKILL.md.

Preferred authoring pattern

Use Vizro's Plotly Express wrappers for standard charts:

import vizro.models as vm
import vizro.plotly.express as px

fig = px.scatter(
    px.data.iris(),
    x="sepal_width",
    y="sepal_length",
    color="species",
)

page = vm.Page(title="Iris", components=[vm.Graph(figure=fig)])

When users supply data and a visual goal, first decide chart semantics, then write code:

  1. Identify measures, dimensions, time fields, categorical fields, and intended comparison.
  2. Choose chart type from visual-vocabulary principles.
  3. Produce a small Plotly/Vizro snippet using explicit column names.
  4. Wrap it in vm.Graph or the relevant table/grid component.
  5. Add filters/selectors only after the base figure works.

Chart selection heuristics

  • Time trend: line/area; use bars only for few discrete periods.
  • Category comparison: bar/column; sort intentionally.
  • Distribution: histogram/box/violin depending on whether the user needs bins, summary, or group comparison.
  • Relationship/correlation: scatter/bubble; add color/facet only when it clarifies.
  • Part-to-whole: stacked bar or treemap/sunburst for hierarchy; avoid pie for many categories.
  • Geospatial: map only when location is the analytic dimension; otherwise avoid decorative maps.
  • Table: use when exact values, sorting/filtering, or row-level inspection matters more than visual pattern.

Custom charts

Use custom chart callables when vizro.plotly.express wrappers do not cover the needed figure or the chart needs reusable parameters.

Keep custom chart functions:

  • Pure and deterministic over input data/arguments.
  • Returning a Plotly figure or Vizro-compatible figure object.
  • Small enough to test independently.
  • Free of server startup, file I/O, and network calls unless explicitly required.

Tables and grids

  • Choose a table/grid when users need exact values, drill-down, sorting/filtering, or row selection.
  • For action-linked graph/table behavior, route to core-components-data-actions after selecting the visual representation.
  • Validate table model fields with scripts/inspect_vizro_schema.py --models Table AgGrid because table field names evolve.

Debug checklist

  • Does the DataFrame contain each referenced column with the expected dtype?
  • Does the chart render outside Vizro as a plain Plotly figure?
  • Is the figure passed to vm.Graph(figure=...), not accidentally to a text/card/table field?
  • Are color/facet/category orders explicit enough for the user's narrative?
  • Are filters using the same data source/columns as the chart?
  • If a chart is generated by an agent, validate/execute the code locally before embedding in a dashboard.

Evidence anchors

  • vizro-core/src/vizro/plotly/express.py: wrapper API surface.
  • vizro-core/src/vizro/figures/library.py: built-in figure helpers.
  • vizro-core/src/vizro/models/types.py: figure typing.
  • vizro-core/docs/pages/user-guides/custom-charts.md and table.md.
  • vizro-core/examples/visual-vocabulary/README.md.
  • vizro-e2e-flow/skills/selecting-vizro-charts/references/chart-best-practices.md.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351