@antv/t8
Version:
T8 is a text visualization solution for unstructured data within the AntV technology stack, and it is a declarative T8 markdown syntax that can be used to describe the content of data interpretation reports.
62 lines • 1.77 kB
TypeScript
import { SeedTokenOptions } from './theme';
import { PluginType } from './plugin';
import EE from '@antv/event-emitter';
/**
* Text component for rendering narrative text visualizations.
*
* Usage:
* ```javascript
* const text = new Text('#container');
* text.theme('light').render(`
* # Sales Report
* Total sales are [¥1,234,567](metric_value).
* `);
* ```
*/
export declare class Text extends EE {
/**
* Container for the text visualization.
*/
container: HTMLElement;
/**
* Specification for the narrative text visualization.
*/
private spec;
/**
* Theme configuration for the text visualization.
*/
private themeSeedToken;
/**
* Plugin manager for the text visualization.
*/
private pluginManager;
constructor(container: string | HTMLElement);
/**
* Set the theme for the narrative text visualization.
* @param theme - The theme configuration for the text visualization.
* @returns The Text instance for method chaining.
*/
theme(theme: 'dark' | 'light', seedToken?: Partial<SeedTokenOptions>): this;
/**
* Register a plugin for the text visualization.
* @param plugin - The plugin to register.
* @returns The Text instance for method chaining.
*/
registerPlugin(plugin: PluginType): this;
/**
* Render the narrative text visualization.
* Accepts a T8 syntax string for rendering.
* @param t8Syntax - T8 syntax string to render.
* @returns A function to unmount the component.
*/
render(t8Syntax?: string): () => void;
/**
* Clear the visualization.
*/
clear(): void;
/**
* Unmount the component.
*/
unmount(): void;
}
//# sourceMappingURL=text.d.ts.map