|
| 1 | +--- |
| 2 | +title: Interactive Examples |
| 3 | +--- |
| 4 | + |
| 5 | +<script setup> |
| 6 | +const marketAnalysisSyntax = `# 2024 Smartphone Market Analysis |
| 7 | +
|
| 8 | +## Market Overview |
| 9 | +
|
| 10 | +Global [smartphone shipments](metric_name) reached [1.2 billion units](metric_value, origin=1200000000) in [2024](time_desc), showing a [modest decline of 2.1%](ratio_value, origin=-0.021, assessment="negative") year-over-year. |
| 11 | +
|
| 12 | +The **premium segment** (devices over $800) showed *remarkable* [resilience](trend_desc, assessment="positive"), growing by [5.8%](ratio_value, origin=0.058, assessment="positive"). [Average selling price](other_metric_value) was [$420](metric_value, origin=420, unit="USD"). |
| 13 | +
|
| 14 | +## Key Findings |
| 15 | +
|
| 16 | +1. [Asia-Pacific](dim_value) remains the __largest market__ |
| 17 | +2. [Premium devices](dim_value) showed **strong growth** |
| 18 | +3. Budget segment faced *headwinds* |
| 19 | +
|
| 20 | +### Asia-Pacific |
| 21 | +
|
| 22 | +[Asia-Pacific](dim_value) remains the largest market with [680 million units](metric_value, origin=680000000) shipped, though this represents a [decline of 180 million units](delta_value, origin=-180000000, assessment="negative") from the previous year. |
| 23 | +
|
| 24 | +Key markets: |
| 25 | +- [China](dim_value): [320M units](metric_value, origin=320000000) - down [8.5%](ratio_value, origin=-0.085, assessment="negative"), [ranked 1st](rank, detail=[320, 180, 90, 65, 45]) globally, accounting for [47%](contribute_ratio, origin=0.47, assessment="positive") of regional sales |
| 26 | +- [India](dim_value): [180M units](metric_value, origin=180000000) - up [12.3%](ratio_value, origin=0.123, assessment="positive"), [ranked 2nd](rank, detail=[320, 180, 90, 65, 45]), representing [3 out of 4](proportion, origin=0.45) of the budget segment |
| 27 | +- [Southeast Asia](dim_value): [180M units](metric_value, origin=180000000) - [stable](trend_desc, assessment="equal") |
| 28 | +
|
| 29 | +The [gap of 140M units](difference, detail=[200, 180, 160, 140]) between [China](dim_value) and [India](dim_value) is [narrowing](trend_desc, assessment="neutral"). |
| 30 | +
|
| 31 | +### Market Dynamics |
| 32 | +
|
| 33 | +Sales showed [strong correlation](association, detail=[{"x":100,"y":105},{"x":120,"y":128},{"x":150,"y":155}]) with economic indicators. The [distribution](distribution, detail=[15, 25, 35, 15, 10]) was [uneven](anomaly, detail=[15, 18, 20, 65, 22]), with [unexpected concentration](anomaly, detail=[15, 18, 20, 65, 22]) in urban areas. |
| 34 | +
|
| 35 | +We observed [clear seasonality](seasonality, detail={"data":[80, 90, 95, 135], "range":[0, 150]}) with [Q4 peaks](seasonality, detail={"data":[80, 90, 95, 135]}) driven by holiday shopping. |
| 36 | +
|
| 37 | +For detailed methodology, visit [our research page](https://example.com/methodology).`; |
| 38 | +</script> |
| 39 | + |
| 40 | +# Interactive Examples |
| 41 | + |
| 42 | +Explore comprehensive examples of T8 features and capabilities. Each example demonstrates different aspects of T8's text visualization power and includes the full T8 Syntax source code. |
| 43 | + |
| 44 | +## Example: 2024 Smartphone Market Analysis |
| 45 | + |
| 46 | +This comprehensive example showcases T8's capabilities for rendering data-driven narrative text with rich entity annotations and inline visualizations. The example includes: |
| 47 | + |
| 48 | +- Multiple entity types (metrics, dimensions, trends, ratios, etc.) |
| 49 | +- Inline mini-charts (distributions, correlations, seasonality) |
| 50 | +- Complex data relationships (rankings, proportions, comparisons) |
| 51 | +- Structured markdown with sections and subsections |
| 52 | + |
| 53 | +### Streaming Render |
| 54 | + |
| 55 | +Watch the content render incrementally, simulating real-time data streaming or AI-generated content. Perfect for scenarios where data arrives progressively. |
| 56 | + |
| 57 | +<T8Example :syntax="marketAnalysisSyntax" mode="streaming" /> |
| 58 | + |
| 59 | +### Dark Theme with Custom Settings |
| 60 | + |
| 61 | +The same content rendered with a dark theme and custom typography settings (12px font size, 20px line height). |
| 62 | + |
| 63 | +<T8Example :syntax="marketAnalysisSyntax" mode="dark" container-class="dark" /> |
| 64 | + |
| 65 | +### Custom Plugin - Styled Dimension Values |
| 66 | + |
| 67 | +This example demonstrates how to customize entity rendering using plugins. Here, dimension values (like country/region names) are styled with custom colors and fonts. |
| 68 | + |
| 69 | +<T8Example :syntax="marketAnalysisSyntax" mode="custom-plugin" /> |
| 70 | + |
| 71 | +## Understanding T8 Syntax |
| 72 | + |
| 73 | +The examples above use **T8 Syntax** - a markdown-based declarative language for narrative text visualization. Key features demonstrated: |
| 74 | + |
| 75 | +### Entity Annotations |
| 76 | + |
| 77 | +Entities are marked using bracket notation: `[text](entity_type, properties)` |
| 78 | + |
| 79 | +- `[smartphone shipments](metric_name)` - Metric names |
| 80 | +- `[1.2 billion units](metric_value, origin=1200000000)` - Metric values with raw data |
| 81 | +- `[2024](time_desc)` - Time descriptions |
| 82 | +- `[modest decline of 2.1%](ratio_value, origin=-0.021, assessment="negative")` - Ratios with sentiment |
| 83 | +- `[Asia-Pacific](dim_value)` - Dimension values (categories, regions, etc.) |
| 84 | +- `[resilience](trend_desc, assessment="positive")` - Trend descriptions |
| 85 | +- `[ranked 1st](rank, detail=[320, 180, 90, 65, 45])` - Rankings with data |
| 86 | + |
| 87 | +### Inline Visualizations |
| 88 | + |
| 89 | +- `[distribution](distribution, detail=[15, 25, 35, 15, 10])` - Mini bar charts |
| 90 | +- `[strong correlation](association, detail=[...])` - Scatter plots |
| 91 | +- `[clear seasonality](seasonality, detail={...})` - Line charts |
| 92 | +- `[gap of 140M units](difference, detail=[200, 180, 160, 140])` - Difference indicators |
| 93 | + |
| 94 | +### Markdown Formatting |
| 95 | + |
| 96 | +Standard markdown syntax is supported: |
| 97 | + |
| 98 | +- `**bold**` for emphasis |
| 99 | +- `*italic*` for subtle emphasis |
| 100 | +- `__underline__` for highlighting |
| 101 | +- Headers (`#`, `##`, `###`) for structure |
| 102 | +- Lists (numbered and bulleted) |
| 103 | +- Links |
| 104 | + |
| 105 | +Learn more in the [T8 Syntax Documentation](/en/syntax/). |
0 commit comments