Commit Graph

27 Commits

Author SHA1 Message Date
hailin e12f169319 fix: normalize style with full defaults when chart enters Redux
All style sub-objects (title, legend, xAxis, yAxis, dataLabel,
background, border, animation) are guaranteed to exist in Redux.
This fixes:
- Style config panels showing blank (returned null for missing fields)
- Style changes not applying (updateStyle now deep-merges sub-objects)
- Color palette changes not persisting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:56:09 -07:00
hailin 1ee9d57222 fix: color palette properly applied to bar charts
- ensureStyle: handle empty colors array (use defaults)
- barOptionBuilder: set option.color = style.colors globally
  so ECharts auto-assigns palette colors to all series
- Changing palette in style panel now updates chart colors immediately

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:53:10 -07:00
hailin 53669b66b8 fix: label binding auto-enables data labels on bar chart
When a field is dragged to the 'label' slot, data labels are
automatically shown on top of each bar with the value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:47:43 -07:00
hailin 10b50bb2e0 feat: color binding splits bar chart into colored series with legend
Dragging a field to the 'color' slot now creates separate colored bars
per category value, with auto-generated legend. Also aggregates
multiple rows per category (sum) instead of taking first match only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:46:49 -07:00
hailin bb9273706e feat: redesign KPI card to enterprise standard
- Metric name (column name) as title
- Large formatted number with 万/亿 abbreviation
- Auto-detect 同比/环比 columns, show as colored trend badges
- Group label showing dimension info
- SVG sparkline for trend visualization
- Clean layout matching Tableau/Power BI KPI card patterns

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:42:25 -07:00
hailin 12f7f04d82 fix: field drag uses text/plain to match DataBinding drop handler
LeftPanel was setting application/json but DataBinding reads text/plain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:37:59 -07:00
hailin 735f00cbc3 fix: KPI card label shows column name instead of first row value
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:36:12 -07:00
hailin 36c5b42f53 fix: ensure complete StyleConfig defaults in ECharts builder
Root cause: backend returns minimal style object without title/legend/axis
sub-objects, causing TypeError 'Cannot read properties of undefined'.
Fix: normalize style with full defaults at the builder entry point,
protecting ALL chart type builders uniformly.
Also fix antd deprecation warnings (destroyOnClose -> destroyOnHidden).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:31:37 -07:00
hailin b7edc7f86e fix: protect ECharts setOption from invalid data + add import debug logs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:24:25 -07:00
hailin 9b218a487a fix: wire real DataBinding/StyleConfig/InteractionConfig into RightPanel
Replaced placeholder text with actual configPanel components.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:17:48 -07:00
hailin b07e8bb3d5 fix: show detailed import errors + improve KPICard
- DropZone: log actual error message instead of generic text
- KPICard: aggregate all rows, auto-detect 同比/环比 columns,
  show proper formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:16:53 -07:00
hailin e8f2554aa8 feat: Chinese chart labels + matching Ant Design icons
All 17 chart types now show Chinese names (柱状图, 折线图, 饼图, etc.)
and use specific Ant Design icons instead of generic BarChartOutlined.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:11:46 -07:00
hailin fe6cf014dc feat: auto-bind chart fields based on dataset columns
When creating a chart, automatically assign first text column to X axis
and first number column to Y axis (varies by chart type).
Charts now show data immediately instead of blank.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:57:54 -07:00
hailin ccbe63f9e4 fix: API path prefix + style defaults for chart rendering
- All 4 API clients now consistently use /api/v1/ prefix on all routes
- ChartRenderer fills missing style fields with defaults to prevent
  undefined property crashes when backend returns minimal style
- KPICard uses safe defaults for background/border/title

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:53:58 -07:00
hailin d03ee90f40 fix: replace WidthProvider with ResizeObserver for grid layout
react-grid-layout v2 removed WidthProvider. Use ResizeObserver to
track container width and pass it directly to Responsive component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:48:25 -07:00
hailin 28ebbbfb82 fix: critical data mapping bugs in useImportData and useCreateChart
- useImportData: use dataset_id instead of id from backend response,
  fetch rows after import, fix column type mapping
- useCreateChart: fix bindings mapper to use axis instead of fieldRole,
  graceful error handling instead of throwing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:43:16 -07:00
hailin 0c0592b511 fix: wire chart creation onClick in LeftPanel chart gallery
Clicking a chart type card now calls useCreateChart to create
a chart instance on the backend and add it to the canvas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:39:18 -07:00
hailin b222429475 fix: dynamic import react-grid-layout to avoid SSR crash
WidthProvider is not available during SSR. Use dynamic import
inside useEffect to load it only on the client side.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:29:35 -07:00
hailin 79c144d74b fix: wire real components into AppShell instead of placeholders
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:26:29 -07:00
hailin 9d2969410e fix: use Response class for 204 DELETE routes
FastAPI latest rejects 204 with response body.
Use response_class=Response and return Response(status_code=204).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:07:55 -07:00
hailin dc7303875f fix: use Tsinghua PyPI mirror in all Dockerfiles
pip install from pypi.org times out in China network.
Use https://pypi.tuna.tsinghua.edu.cn/simple for both pip and poetry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:03:30 -07:00
hailin 43e5f468eb fix: unify all services to poetry pyproject.toml format
template-service and export-service used [project]+setuptools format
which is incompatible with poetry install in Dockerfile.
Unified to [tool.poetry] + poetry-core build-backend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 00:58:40 -07:00
hailin 2a5a47b18e fix: add [build-system] to data-service and chart-service pyproject.toml
Poetry 2.x requires build-system section, otherwise poetry install fails with exit code 2.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 00:54:42 -07:00
hailin eb04d7da3b fix: use host network for Docker build, remove obsolete version
Build stage uses network: host so pip can resolve DNS through host.
Removed version: "3.9" (obsolete warning).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 00:47:31 -07:00
hailin 6e7a80466c fix: correct alembic.ini path in Dockerfiles
data-service and chart-service have alembic.ini inside alembic/ dir,
not at service root. Remove the separate COPY line.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 00:40:54 -07:00
hailin 6079ec8b97 feat: add frontend source code (Next.js + React + TypeScript)
Previously excluded due to nested .git from create-next-app.
Includes all Clean Architecture layers, API client integration,
and full UI component suite.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 23:33:37 -07:00
hailin 6e3127e7d6 feat: DataViz Pro full-stack data visualization platform
- Frontend: Next.js + React + TypeScript + ECharts + Ant Design + Redux/Zustand (Clean Architecture)
- Backend: FastAPI + PostgreSQL + SQLAlchemy (DDD + Clean Architecture + Microservices)
- 4 microservices: data-service, chart-service, template-service, export-service
- 15+ chart types, drag-drop layout, multi-format export
- Docker Compose orchestration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 23:20:12 -07:00