{"path":"QUICKSTART.md","size":2222,"locked":false,"binary":false,"truncated":false,"content":"# QUICKSTART — CanvasQuantChartPro\n\nGet up and running in under 5 minutes.\n\n### 1. Direct Script Include (Vanilla HTML/JS)\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n  <style>\n    #chart { width: 100%; height: 500px; background: #09090d; }\n  </style>\n</head>\n<body>\n  <div id=\"chart\"></div>\n\n  <script type=\"module\">\n    import { CanvasQuantChart } from './src/canvas-quant-chart.js';\n\n    const container = document.getElementById('chart');\n    const chart = new CanvasQuantChart(container, {\n      theme: 'dark',\n      candleUpColor: '#10b981',\n      candleDownColor: '#f43f5e'\n    });\n\n    const candles = [\n      { open: 64100, high: 64500, low: 64000, close: 64400, timestamp_ms: 1710000000000 },\n      { open: 64400, high: 64800, low: 64300, close: 64750, timestamp_ms: 1710003600000 }\n    ];\n\n    const forecast = {\n      horizon: 'H1',\n      expected_return_pct: 1.25,\n      quantiles: {\n        expected_return_pct: 1.25,\n        q10: -0.5,\n        q25: 0.3,\n        q50: 1.25,\n        q75: 2.2,\n        q90: 3.1\n      }\n    };\n\n    chart.setData(candles, forecast);\n  </script>\n</body>\n</html>\n```\n\n### 2. React 18 / 19 Integration\n\n```tsx\nimport React, { useEffect, useRef } from 'react';\nimport { CanvasQuantChart } from './canvas-quant-chart.js';\n\nexport function QuantChartComponent({ candles, forecast }) {\n  const containerRef = useRef<HTMLDivElement>(null);\n  const chartRef = useRef<CanvasQuantChart | null>(null);\n\n  useEffect(() => {\n    if (!containerRef.current) return;\n\n    chartRef.current = new CanvasQuantChart(containerRef.current, {\n      theme: 'dark'\n    });\n\n    return () => {\n      chartRef.current?.destroy();\n    };\n  }, []);\n\n  useEffect(() => {\n    chartRef.current?.setData(candles, forecast);\n  }, [candles, forecast]);\n\n  return <div ref={containerRef} style={{ width: '100%', height: '500px' }} />;\n}\n```\n\n### 3. Key Methods\n- `chart.setData(candles, forecast)`: Updates data and triggers immediate re-render.\n- `chart.setForecast(forecast)`: Updates or clears forecast overlay without modifying historical candles.\n- `chart.resetView()`: Resets zoom and pan offsets back to default perspective.\n- `chart.destroy()`: Disconnects resize observers and removes canvas element cleanly.\n"}