Skip to content
Back to skills

Visualization

ASecurity

"Use LangExtract visualization to save, reload, inspect, and render

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
documentationpythonbashapifrontend

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill visualization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Visualization?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Visualization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-visualization-arex-skill/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-visualization-arex-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: visualization
description: "Use LangExtract visualization to save, reload, inspect, and render
  AnnotatedDocument JSONL outputs without model inference."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# LangExtract Visualization

Use this sub-skill when the user already has LangExtract `AnnotatedDocument`
objects or saved JSONL output and wants to persist, reload, inspect, or render an
interactive HTML visualization without calling a model.

## Route first

- To create new extraction results with `lx.extract()`, read
  `../extraction/SKILL.md` first.
- For model IDs, API keys, Vertex/OpenAI batch settings, Ollama, or provider
  credentials, read `../providers/SKILL.md`.
- For frontend code changes beyond the HTML generated by LangExtract, treat the
  request as unsupported by this repo skill and explain that custom UI work is a
  gap.

## Common workflows

1. **Save one or more annotated documents to JSONL.** Use
   `lx.io.save_annotated_documents([doc], output_dir=..., output_name=..., show_progress=...)`.
   The default filename is `data.jsonl`; when `output_dir=None`, LangExtract
   writes under a relative `test_output/` directory. Prefer an explicit output
   directory in agent-written code.
2. **Reload JSONL for later inspection.** Use
   `lx.io.load_annotated_documents_jsonl(path, show_progress=...)` and
   materialize the iterator only when the file is small enough. Use
   `langextract.data_lib` conversions when you need JSON dictionaries rather
   than dataclass objects.
3. **Visualize a document or JSONL file.** Use `lx.visualize(doc_or_jsonl_path)`
   or `langextract.visualization.visualize(...)` with
   `animation_speed`, `show_legend`, and `gif_optimized` as needed. A JSONL path
   visualizes the first document in the file; load and select a document
   yourself for multi-document outputs.
4. **Write HTML safely.** In a notebook, the return value may be an
   `IPython.display.HTML` object with `.data`; in plain Python it is a string.
   Use `payload = html.data if hasattr(html, "data") else html` before writing.
5. **Check grounding before blaming visualization.** Only extractions with a
   usable `char_interval` can be highlighted. Missing or invalid intervals
   usually mean the extraction was ungrounded or manually constructed with bad
   offsets.

Read `references/workflows.md` for verified signatures, JSONL round trips,
selection patterns, and HTML writing details. Read
`references/troubleshooting.md` for save/load/visualization failures and their
fixes.

## Bundled helper

Run `scripts/save_and_visualize.py` when you need a no-model smoke helper that
creates a handcrafted `AnnotatedDocument`, saves JSONL, reloads it, generates
HTML, and writes all outputs under a caller-selected directory:

```bash
python scripts/save_and_visualize.py --output-dir ./lx-viz-demo
```

The helper does not require API keys, provider credentials, network access, or
source-repository files.

## Verification anchors

This guidance is based on the public README save/visualization snippets,
long-document and medication visualization examples, implementation behavior in
`langextract/io.py`, `langextract/visualization.py`, `langextract/data_lib.py`,
`langextract/progress.py`, and `langextract/core/data.py`, installed-package
signature inspection, and the safe native candidate families `io_test.py`,
`data_lib_test.py`, `visualization_test.py`, and `progress_test.py`.

Files in this skill

  • SKILL.md3.4 KB
  • references/troubleshooting.md6.3 KB
  • references/workflows.md7.2 KB
  • scripts/save_and_visualize.py8.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.