@outsidedata/dolex 0.1.0 → 0.1.1
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 +82 -67
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -18,23 +18,90 @@ Every AI assistant suggests a bar chart. Dolex suggests the *right* chart — bu
|
|
|
18
18
|
- **Smart Labels** — truncation, abbreviation, collision avoidance, adaptive strategies
|
|
19
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
20
|
|
|
21
|
-
##
|
|
21
|
+
## Install
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm install dolex
|
|
24
|
+
npm install @outsidedata/dolex
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## MCP Server Setup
|
|
28
|
+
|
|
29
|
+
### Claude Desktop
|
|
30
|
+
|
|
31
|
+
Add this to your Claude Desktop configuration file (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"dolex": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["@outsidedata/dolex"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Restart Claude Desktop. You'll see Dolex's 17 tools available in the tool picker.
|
|
45
|
+
|
|
46
|
+
### Claude Code
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
claude mcp add dolex -- npx @outsidedata/dolex
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Other MCP Clients
|
|
53
|
+
|
|
54
|
+
Any MCP-compatible client (ChatGPT, VS Code, Goose, etc.) can connect via stdio:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx @outsidedata/dolex
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### MCP Tools
|
|
61
|
+
|
|
62
|
+
| Tool | Description |
|
|
63
|
+
|------|-------------|
|
|
64
|
+
| `visualize` | Takes inline data + intent, returns visualization recommendations |
|
|
65
|
+
| `visualize_from_source` | Takes a data source + DSL query + intent, returns visualization recommendations |
|
|
66
|
+
| `list_patterns` | Browse all 43 available patterns |
|
|
67
|
+
| `refine_visualization` | Tweak a visualization — sort, limit, flip axes, change colors, update title |
|
|
68
|
+
| `add_source` | Connect a data source (CSV, SQLite, PostgreSQL, MySQL) |
|
|
69
|
+
| `list_sources` | List all connected data sources |
|
|
70
|
+
| `remove_source` | Disconnect and remove a data source |
|
|
71
|
+
| `describe_source` | Column profiles for a data source |
|
|
72
|
+
| `analyze_source` | Generate a structured analysis plan with ready-to-execute DSL queries |
|
|
73
|
+
| `query_source` | Run a declarative DSL query against a data source |
|
|
74
|
+
| `create_dashboard` | Multi-view dashboard with global filters and cross-view interactions |
|
|
75
|
+
| `refine_dashboard` | Iterate on a dashboard — add/remove views, change layout, filters, themes |
|
|
76
|
+
| `server_status` | Inspect cached data in server memory |
|
|
77
|
+
| `clear_cache` | Clear cached specs and query results |
|
|
78
|
+
| `report_bug` | Generate a sanitized bug report |
|
|
79
|
+
| `export_html` | Return full self-contained HTML for a visualization |
|
|
80
|
+
| `screenshot` | Render a visualization to PNG via headless Chromium |
|
|
81
|
+
|
|
82
|
+
## Pattern Catalog
|
|
83
|
+
|
|
84
|
+
| Category | Patterns |
|
|
85
|
+
|----------|----------|
|
|
86
|
+
| **Comparison** (9) | Bar, Diverging Bar, Slope Chart, Connected Dot Plot, Bump Chart, Lollipop, Bullet, Grouped Bar, Waterfall |
|
|
87
|
+
| **Distribution** (7) | Histogram, Beeswarm, Violin, Ridgeline, Strip Plot, Box Plot, Density Plot |
|
|
88
|
+
| **Composition** (9) | Stacked Bar, Waffle, Treemap, Sunburst, Circle Pack, Metric, Donut, Marimekko, Icicle |
|
|
89
|
+
| **Time** (7) | Line, Area, Small Multiples, Sparkline Grid, Calendar Heatmap, Stream Graph, Horizon Chart |
|
|
90
|
+
| **Relationship** (5) | Scatter, Connected Scatter, Parallel Coordinates, Radar, Heatmap |
|
|
91
|
+
| **Flow** (4) | Sankey, Alluvial, Chord, Funnel |
|
|
92
|
+
| **Geo** (2) | Choropleth, Proportional Symbol |
|
|
93
|
+
|
|
94
|
+
## Library Usage
|
|
95
|
+
|
|
27
96
|
### Pattern Selection
|
|
28
97
|
|
|
29
98
|
```typescript
|
|
30
|
-
import { selectPattern, registry } from 'dolex';
|
|
99
|
+
import { selectPattern, registry } from '@outsidedata/dolex';
|
|
31
100
|
|
|
32
|
-
// Let Dolex choose the right pattern
|
|
33
101
|
const result = selectPattern(data, columns, 'compare rankings over time');
|
|
34
102
|
console.log(result.recommended.pattern.name); // "Bump Chart"
|
|
35
103
|
console.log(result.recommended.reasoning);
|
|
36
104
|
|
|
37
|
-
// Browse all patterns
|
|
38
105
|
const patterns = registry.getAll(); // 43 patterns
|
|
39
106
|
const comparison = registry.getByCategory('comparison'); // 9 patterns
|
|
40
107
|
```
|
|
@@ -42,7 +109,7 @@ const comparison = registry.getByCategory('comparison'); // 9 patterns
|
|
|
42
109
|
### React Components
|
|
43
110
|
|
|
44
111
|
```tsx
|
|
45
|
-
import { BumpChart, Beeswarm, Waffle, Scatter, Line } from 'dolex/react';
|
|
112
|
+
import { BumpChart, Beeswarm, Waffle, Scatter, Line } from '@outsidedata/dolex/react';
|
|
46
113
|
|
|
47
114
|
function Dashboard({ spec }) {
|
|
48
115
|
return <BumpChart spec={spec} width={800} height={500} />;
|
|
@@ -54,91 +121,39 @@ Available components: `Bar`, `DivergingBar`, `SlopeChart`, `BumpChart`, `Connect
|
|
|
54
121
|
### HTML Builders (MCP Apps / Iframes)
|
|
55
122
|
|
|
56
123
|
```typescript
|
|
57
|
-
import { buildChartHtml } from 'dolex/html';
|
|
124
|
+
import { buildChartHtml } from '@outsidedata/dolex/html';
|
|
58
125
|
|
|
59
126
|
const html = buildChartHtml(spec);
|
|
60
127
|
// Complete self-contained HTML document with embedded D3 + data
|
|
61
|
-
// Perfect for iframe srcdoc, MCP Apps, or saving to file
|
|
62
128
|
```
|
|
63
129
|
|
|
64
130
|
### Theme
|
|
65
131
|
|
|
66
132
|
```typescript
|
|
67
|
-
import { theme, getTheme } from 'dolex/theme';
|
|
133
|
+
import { theme, getTheme } from '@outsidedata/dolex/theme';
|
|
68
134
|
|
|
69
135
|
const dark = getTheme('dark');
|
|
70
|
-
const bg = dark.colors.background;
|
|
71
136
|
const palette = dark.palettes.categorical;
|
|
72
|
-
const titleStyle = dark.typography.textStyles.chartTitle;
|
|
73
137
|
```
|
|
74
138
|
|
|
75
139
|
### Smart Labels
|
|
76
140
|
|
|
77
141
|
```typescript
|
|
78
|
-
import { labelStrategy, truncateLabel, abbreviate } from 'dolex/utils';
|
|
142
|
+
import { labelStrategy, truncateLabel, abbreviate } from '@outsidedata/dolex/utils';
|
|
79
143
|
|
|
80
|
-
// Automatically choose the best labeling strategy
|
|
81
144
|
const strategy = labelStrategy(['January Sales', 'February Sales', ...], 400);
|
|
82
|
-
// Returns { mode: 'abbreviated', labels: ['Jan Sales', 'Feb Sales', ...] }
|
|
83
|
-
|
|
84
|
-
// Or use individual utilities
|
|
85
|
-
truncateLabel('Very Long Category Name', 80); // "Very Long Ca…"
|
|
86
|
-
abbreviate('Department of Technology'); // "Dept of Tech"
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Pattern Catalog
|
|
90
|
-
|
|
91
|
-
| Category | Patterns |
|
|
92
|
-
|----------|----------|
|
|
93
|
-
| **Comparison** (9) | Bar, Diverging Bar, Slope Chart, Connected Dot Plot, Bump Chart, Lollipop, Bullet, Grouped Bar, Waterfall |
|
|
94
|
-
| **Distribution** (7) | Histogram, Beeswarm, Violin, Ridgeline, Strip Plot, Box Plot, Density Plot |
|
|
95
|
-
| **Composition** (9) | Stacked Bar, Waffle, Treemap, Sunburst, Circle Pack, Metric, Donut, Marimekko, Icicle |
|
|
96
|
-
| **Time** (7) | Line, Area, Small Multiples, Sparkline Grid, Calendar Heatmap, Stream Graph, Horizon Chart |
|
|
97
|
-
| **Relationship** (5) | Scatter, Connected Scatter, Parallel Coordinates, Radar, Heatmap |
|
|
98
|
-
| **Flow** (4) | Sankey, Alluvial, Chord, Funnel |
|
|
99
|
-
| **Geo** (2) | Choropleth, Proportional Symbol |
|
|
100
|
-
|
|
101
|
-
## MCP Server
|
|
102
|
-
|
|
103
|
-
Dolex includes an MCP server for AI assistant integration.
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
# Run via stdio (for Claude Desktop, etc.)
|
|
107
|
-
npx dolex
|
|
108
145
|
```
|
|
109
146
|
|
|
110
|
-
### MCP Tools
|
|
111
|
-
|
|
112
|
-
| Tool | Description |
|
|
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 |
|
|
131
|
-
|
|
132
147
|
## Exports Map
|
|
133
148
|
|
|
134
149
|
| Import Path | Contents |
|
|
135
150
|
|-------------|----------|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
151
|
+
| `@outsidedata/dolex` | Types, patterns, theme, utilities, HTML builders |
|
|
152
|
+
| `@outsidedata/dolex/react` | React components (requires React >=18) |
|
|
153
|
+
| `@outsidedata/dolex/html` | Self-contained HTML chart builders |
|
|
154
|
+
| `@outsidedata/dolex/theme` | Design system tokens |
|
|
155
|
+
| `@outsidedata/dolex/utils` | Smart labels, responsive, export utilities |
|
|
156
|
+
| `@outsidedata/dolex/patterns` | Pattern registry and selector |
|
|
142
157
|
|
|
143
158
|
## Development
|
|
144
159
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outsidedata/dolex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
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": {
|