@malloydata/render 0.0.343 → 0.0.344
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/CONTEXT.md +0 -93
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/render",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.344",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/module/index.umd.js",
|
|
6
6
|
"types": "dist/module/index.d.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"generate-flow": "ts-node ../../scripts/gen-flow.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
33
|
-
"@malloydata/malloy-tag": "0.0.
|
|
32
|
+
"@malloydata/malloy-interfaces": "0.0.344",
|
|
33
|
+
"@malloydata/malloy-tag": "0.0.344",
|
|
34
34
|
"@tanstack/solid-virtual": "^3.10.4",
|
|
35
35
|
"lodash": "^4.17.20",
|
|
36
36
|
"luxon": "^3.5.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"vega-lite": "^5.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@malloydata/db-duckdb": "0.0.
|
|
46
|
-
"@malloydata/malloy": "0.0.
|
|
45
|
+
"@malloydata/db-duckdb": "0.0.344",
|
|
46
|
+
"@malloydata/malloy": "0.0.344",
|
|
47
47
|
"@storybook/addon-essentials": "^8.6.15",
|
|
48
48
|
"@storybook/addon-interactions": "^8.6.15",
|
|
49
49
|
"@storybook/addon-links": "^8.6.15",
|
package/CONTEXT.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Malloy Render
|
|
2
|
-
|
|
3
|
-
The `malloy-render` package handles visualization and rendering of Malloy query results. It transforms query results into rich, interactive visualizations and tables.
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
Malloy queries return structured data with metadata about how it should be displayed. The render package:
|
|
8
|
-
- Interprets query result metadata
|
|
9
|
-
- Generates appropriate visualizations
|
|
10
|
-
- Provides interactive data exploration
|
|
11
|
-
- Supports multiple rendering formats
|
|
12
|
-
|
|
13
|
-
## Technology Stack
|
|
14
|
-
|
|
15
|
-
### Solid.js
|
|
16
|
-
The rendering system uses **Solid.js** as its reactive UI framework.
|
|
17
|
-
|
|
18
|
-
### Vega
|
|
19
|
-
The package uses **Vega** for declarative data visualizations.
|
|
20
|
-
|
|
21
|
-
## Rendering Process
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
Query Results + Metadata → Renderer → Visualization Selection → Vega Spec / Table → UI Output
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**Steps:**
|
|
28
|
-
1. Query results arrive with rendering metadata
|
|
29
|
-
2. Renderer examines result structure and annotations
|
|
30
|
-
3. Appropriate visualization type is selected
|
|
31
|
-
4. Vega specification is generated (for charts) or table is formatted
|
|
32
|
-
5. UI components render the visualization
|
|
33
|
-
|
|
34
|
-
## Rendering Hints
|
|
35
|
-
|
|
36
|
-
The renderer respects annotations and metadata from Malloy models:
|
|
37
|
-
|
|
38
|
-
- **Renderer annotations** (prefix `# `) provide display hints
|
|
39
|
-
- **Field types** influence default visualizations
|
|
40
|
-
- **Data structure** (nested, flat, aggregated) affects rendering choices
|
|
41
|
-
- **User preferences** can override defaults
|
|
42
|
-
|
|
43
|
-
## Visualization Types
|
|
44
|
-
|
|
45
|
-
The renderer supports various output formats:
|
|
46
|
-
|
|
47
|
-
- **Tables** - Default for most query results
|
|
48
|
-
- **Bar charts** - For categorical comparisons
|
|
49
|
-
- **Line charts** - For time series data
|
|
50
|
-
- **Scatter plots** - For correlation analysis
|
|
51
|
-
- **Nested tables** - For hierarchical data
|
|
52
|
-
- **Sparklines** - For inline visualizations
|
|
53
|
-
- And more...
|
|
54
|
-
|
|
55
|
-
## Package Integration
|
|
56
|
-
|
|
57
|
-
The render package integrates with:
|
|
58
|
-
- **malloy-core** - Consumes query results and metadata
|
|
59
|
-
- **VS Code extension** - Provides visualization in editor
|
|
60
|
-
- **Web applications** - Can be embedded in web apps
|
|
61
|
-
- **Reports** - Generates static visualizations
|
|
62
|
-
|
|
63
|
-
## Architecture
|
|
64
|
-
|
|
65
|
-
### Two Renderers
|
|
66
|
-
- **New renderer** (`src/component/`) - Solid.js-based, the default
|
|
67
|
-
- **Legacy renderer** (`src/html/`) - HTML string-based, activated with `## renderer_legacy` model tag
|
|
68
|
-
|
|
69
|
-
### Tag System
|
|
70
|
-
Render annotations use the Malloy Tag API to check for rendering hints. For tag language syntax, see [packages/malloy-tag/CONTEXT.md](../malloy-tag/CONTEXT.md).
|
|
71
|
-
|
|
72
|
-
Common API patterns in the renderer:
|
|
73
|
-
- `field.tag.has('pivot')` - Check if a tag exists
|
|
74
|
-
- `field.tag.text('label')` - Get a text property
|
|
75
|
-
- `field.tag.textArray('pivot', 'dimensions')` - Get array property with path
|
|
76
|
-
- `field.tag.tag('table', 'size')` - Navigate nested tag properties
|
|
77
|
-
|
|
78
|
-
### Table Layout
|
|
79
|
-
The table uses CSS Grid with subgrid. Layout is calculated in `table-layout.ts`:
|
|
80
|
-
- `getTableLayout()` - Creates base layout from field structure
|
|
81
|
-
- `adjustLayoutForPivots()` - Adjusts column counts for pivot expansion
|
|
82
|
-
- Column ranges are tracked for each field to support nested tables
|
|
83
|
-
|
|
84
|
-
### Testing
|
|
85
|
-
Use Storybook (`npm run storybook`) to test visual changes. Stories are in `src/stories/*.stories.malloy`.
|
|
86
|
-
|
|
87
|
-
## Important Notes
|
|
88
|
-
|
|
89
|
-
- Rendering is **separate from query execution** - it only processes results
|
|
90
|
-
- The renderer is **stateless** - same results produce same visualizations
|
|
91
|
-
- Visualizations respect **user accessibility** preferences where possible
|
|
92
|
-
- The package is designed to be **embeddable** in various contexts
|
|
93
|
-
- **Never run the full test suite** without restrictions - use targeted tests or storybook
|