Schema ​
Overview ​
T8 Schema is a JSON Schema specification for declaratively describing data interpretation reports. It provides a complete type system for building structured narrative text visualization content.
Core Concepts ​
T8 Schema system includes the following core concepts:
NarrativeText
- Acts as the top-level container for the entire document
- Contains Headline and multiple Section blocks
- Supports global style configuration
Section
- Used to organize and manage collections of related paragraphs
- Supports standard paragraph groups and custom blocks
- Can be flexibly extended to accommodate different display requirements
Paragraph
- Supports multiple paragraph types: headings, body text, lists, etc.
- Each type has its specific structure and purpose
- Can be extended through custom types
Phrase
- Serves as the smallest unit of text composition
- Includes plain text, entities, and custom phrases
- Supports rich styling and interaction configuration
Type System ​
You can use T8's type definitions in TypeScript projects as follows:
ts
import type {
NarrativeTextSpec,
ParagraphSpec,
PhraseSpec,
// ...
} from '@antv/t8';
The main type definitions include:
NarrativeTextSpec
: Top-level document structureSectionSpec
: Section block structureParagraphSpec
: Paragraph type definitionsPhraseSpec
: Phrase type definitionsEntityType
: Entity type enumerationCommonProps
: Common property definitions
Extensibility ​
T8 Schema has designed a comprehensive extension mechanism:
Custom Blocks
- Extend through the
CustomBlockElement
interface - Can implement completely custom block structures
- Extend through the
Custom Phrases
- Extend through the
CustomPhraseSpec
interface - Supports custom metadata and rendering logic
- Extend through the
Style System
- All components support
CommonProps
- Can customize styles through
styles
andclassName
- All components support
Detailed Documentation ​
- Overall Structure - Understand the overall organization of the Schema
- Type Definitions
- NarrativeText - Top-level text structure
- Section - Section blocks
- Paragraph - Paragraph types
- Phrase & Entity - Phrases and entities