@outsidedata/dolex 0.1.0 → 0.1.2
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/README.md +53 -108
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -4,89 +4,72 @@
|
|
|
4
4
|
|
|
5
5
|
Every AI assistant suggests a bar chart. Dolex suggests the *right* chart — bump charts for rankings, beeswarms for distributions, connected dot plots for two-metric comparisons, waffle charts for precise proportions.
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
- **43 Visualization Patterns** across 7 categories: comparison, distribution, composition, time, relationship, flow, and geo
|
|
10
|
-
- **Pattern Selector** — analyzes data shape + user intent, scores every pattern, returns ranked recommendations with reasoning
|
|
11
|
-
- **Data Source Connectors** — connect CSV, SQLite, PostgreSQL, or MySQL; query with a declarative DSL including joins, aggregations, and time bucketing
|
|
12
|
-
- **React Components** — 43 thin-wrapper components with D3 lifecycle management
|
|
13
|
-
- **HTML Builders** — 43 self-contained HTML documents, perfect for MCP Apps / iframes
|
|
14
|
-
- **MCP Server** — 17 tools for Claude Desktop, ChatGPT, VS Code, and any MCP-compatible client
|
|
15
|
-
- **Dashboard Builder** — multi-view dashboards with global filters and cross-view interactions
|
|
16
|
-
- **Compound Visualizations** — chart + data table with linked highlighting
|
|
17
|
-
- **Design System** — dark/light themes with color palettes, typography, and spacing tokens
|
|
18
|
-
- **Smart Labels** — truncation, abbreviation, collision avoidance, adaptive strategies
|
|
19
|
-
- **Offline Maps** — choropleth and proportional symbol maps with 33 embedded TopoJSON files covering world, continents, US states/counties, and 17 country subdivision maps
|
|
20
|
-
|
|
21
|
-
## Quick Start
|
|
7
|
+
## Install
|
|
22
8
|
|
|
23
9
|
```bash
|
|
24
|
-
npm install dolex
|
|
10
|
+
npm install @outsidedata/dolex
|
|
25
11
|
```
|
|
26
12
|
|
|
27
|
-
|
|
13
|
+
## Claude Desktop
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
import { selectPattern, registry } from 'dolex';
|
|
15
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
31
16
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### React Components
|
|
43
|
-
|
|
44
|
-
```tsx
|
|
45
|
-
import { BumpChart, Beeswarm, Waffle, Scatter, Line } from 'dolex/react';
|
|
46
|
-
|
|
47
|
-
function Dashboard({ spec }) {
|
|
48
|
-
return <BumpChart spec={spec} width={800} height={500} />;
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"dolex": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["@outsidedata/dolex"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
49
25
|
}
|
|
50
26
|
```
|
|
51
27
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
### HTML Builders (MCP Apps / Iframes)
|
|
28
|
+
Restart Claude Desktop. Dolex's 17 tools appear in the tool picker.
|
|
55
29
|
|
|
56
|
-
|
|
57
|
-
import { buildChartHtml } from 'dolex/html';
|
|
30
|
+
## Claude Code
|
|
58
31
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// Perfect for iframe srcdoc, MCP Apps, or saving to file
|
|
32
|
+
```bash
|
|
33
|
+
claude mcp add dolex -- npx @outsidedata/dolex
|
|
62
34
|
```
|
|
63
35
|
|
|
64
|
-
|
|
36
|
+
## Other MCP Clients
|
|
65
37
|
|
|
66
|
-
|
|
67
|
-
import { theme, getTheme } from 'dolex/theme';
|
|
38
|
+
Any MCP-compatible client (ChatGPT, VS Code, Goose, etc.) can connect via stdio:
|
|
68
39
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const palette = dark.palettes.categorical;
|
|
72
|
-
const titleStyle = dark.typography.textStyles.chartTitle;
|
|
40
|
+
```bash
|
|
41
|
+
npx @outsidedata/dolex
|
|
73
42
|
```
|
|
74
43
|
|
|
75
|
-
|
|
44
|
+
## What It Does
|
|
76
45
|
|
|
77
|
-
|
|
78
|
-
import { labelStrategy, truncateLabel, abbreviate } from 'dolex/utils';
|
|
46
|
+
You give Claude your data and ask a question. Dolex analyzes the data shape and your intent, then picks the right visualization from 43 handcrafted patterns — not the obvious chart, the *informative* one.
|
|
79
47
|
|
|
80
|
-
|
|
81
|
-
const strategy = labelStrategy(['January Sales', 'February Sales', ...], 400);
|
|
82
|
-
// Returns { mode: 'abbreviated', labels: ['Jan Sales', 'Feb Sales', ...] }
|
|
48
|
+
Charts render inline in the conversation as interactive HTML. No external dependencies, no CDN calls, fully offline.
|
|
83
49
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
50
|
+
### Tools
|
|
51
|
+
|
|
52
|
+
| Tool | What it does |
|
|
53
|
+
|------|-------------|
|
|
54
|
+
| `visualize` | Inline data + intent → ranked chart recommendations |
|
|
55
|
+
| `visualize_from_source` | Data source + DSL query + intent → chart recommendations |
|
|
56
|
+
| `list_patterns` | Browse all 43 patterns |
|
|
57
|
+
| `refine_visualization` | Tweak a chart — sort, limit, flip axes, colors, title |
|
|
58
|
+
| `add_source` | Connect CSV, SQLite, PostgreSQL, or MySQL |
|
|
59
|
+
| `list_sources` | List connected sources |
|
|
60
|
+
| `remove_source` | Disconnect a source |
|
|
61
|
+
| `describe_source` | Column profiles and sample rows |
|
|
62
|
+
| `analyze_source` | Auto-generate an analysis plan with DSL queries |
|
|
63
|
+
| `query_source` | Run a declarative query (joins, aggregations, filters) |
|
|
64
|
+
| `create_dashboard` | Multi-view dashboard with filters and cross-filtering |
|
|
65
|
+
| `refine_dashboard` | Iterate on a dashboard |
|
|
66
|
+
| `server_status` | Inspect cached data |
|
|
67
|
+
| `clear_cache` | Clear cached specs and results |
|
|
68
|
+
| `report_bug` | Generate a sanitized bug report |
|
|
69
|
+
| `export_html` | Get raw HTML for a chart |
|
|
70
|
+
| `screenshot` | Render a chart to PNG |
|
|
88
71
|
|
|
89
|
-
|
|
72
|
+
### Patterns
|
|
90
73
|
|
|
91
74
|
| Category | Patterns |
|
|
92
75
|
|----------|----------|
|
|
@@ -98,56 +81,18 @@ abbreviate('Department of Technology'); // "Dept of Tech"
|
|
|
98
81
|
| **Flow** (4) | Sankey, Alluvial, Chord, Funnel |
|
|
99
82
|
| **Geo** (2) | Choropleth, Proportional Symbol |
|
|
100
83
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
Dolex includes an MCP server for AI assistant integration.
|
|
84
|
+
### Data Connectors
|
|
104
85
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
- **CSV** — load local CSV files into an in-memory SQLite database
|
|
87
|
+
- **SQLite** — read-only access to SQLite databases
|
|
88
|
+
- **PostgreSQL** — connect to Postgres instances
|
|
89
|
+
- **MySQL** — connect to MySQL instances
|
|
109
90
|
|
|
110
|
-
|
|
91
|
+
All connectors support the declarative DSL query language with joins, aggregations, groupBy (with time bucketing), filters, orderBy, and limit.
|
|
111
92
|
|
|
112
|
-
|
|
113
|
-
|------|-------------|
|
|
114
|
-
| `visualize` | Takes inline data + intent, returns visualization recommendations |
|
|
115
|
-
| `visualize_from_source` | Takes a data source + DSL query + intent, returns visualization recommendations |
|
|
116
|
-
| `list_patterns` | Browse all 43 available patterns |
|
|
117
|
-
| `refine_visualization` | Tweak a visualization — sort, limit, flip axes, change colors, update title |
|
|
118
|
-
| `add_source` | Connect a data source (CSV, SQLite, PostgreSQL, MySQL) |
|
|
119
|
-
| `list_sources` | List all connected data sources |
|
|
120
|
-
| `remove_source` | Disconnect and remove a data source |
|
|
121
|
-
| `describe_source` | Column profiles for a data source |
|
|
122
|
-
| `analyze_source` | Generate a structured analysis plan with ready-to-execute DSL queries |
|
|
123
|
-
| `query_source` | Run a declarative DSL query against a data source |
|
|
124
|
-
| `create_dashboard` | Multi-view dashboard with global filters and cross-view interactions |
|
|
125
|
-
| `refine_dashboard` | Iterate on a dashboard — add/remove views, change layout, filters, themes |
|
|
126
|
-
| `server_status` | Inspect cached data in server memory |
|
|
127
|
-
| `clear_cache` | Clear cached specs and query results |
|
|
128
|
-
| `report_bug` | Generate a sanitized bug report |
|
|
129
|
-
| `export_html` | Return full self-contained HTML for a visualization |
|
|
130
|
-
| `screenshot` | Render a visualization to PNG via headless Chromium |
|
|
93
|
+
### Offline Maps
|
|
131
94
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
| Import Path | Contents |
|
|
135
|
-
|-------------|----------|
|
|
136
|
-
| `dolex` | Types, patterns, theme, utilities, HTML builders |
|
|
137
|
-
| `dolex/react` | React components (requires React >=18) |
|
|
138
|
-
| `dolex/html` | Self-contained HTML chart builders |
|
|
139
|
-
| `dolex/theme` | Design system tokens |
|
|
140
|
-
| `dolex/utils` | Smart labels, responsive, export utilities |
|
|
141
|
-
| `dolex/patterns` | Pattern registry and selector |
|
|
142
|
-
|
|
143
|
-
## Development
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
npm run build # TypeScript compilation
|
|
147
|
-
npm test # Run tests (818 tests)
|
|
148
|
-
npm run dev # Watch mode for MCP server
|
|
149
|
-
npm run mcp:stdio # Run MCP server via tsx
|
|
150
|
-
```
|
|
95
|
+
33 TopoJSON files ship with the package — world maps, US states/counties, 6 continent maps, and 17 country subdivision maps (Germany, France, Japan, China, etc.). All map data is embedded inline in the chart HTML. No CDN calls, ever.
|
|
151
96
|
|
|
152
97
|
## License
|
|
153
98
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outsidedata/dolex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Visualization intelligence for AI — 43 handcrafted chart patterns with React components, MCP server, and self-contained HTML builders",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"choropleth",
|
|
21
21
|
"pattern-library"
|
|
22
22
|
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"dolex": "./dist/src/mcp/index.js"
|
|
25
|
+
},
|
|
23
26
|
"main": "./dist/src/index.js",
|
|
24
27
|
"types": "./dist/src/index.d.ts",
|
|
25
28
|
"exports": {
|