open-index/open-npm huggingface dataset:
npm package: @maxthemillion/vued3-linechart
Description: A vue component that provides a d3.js linechart.
Latest version: 0.1.6

# Reusable D3 Line Chart Component for Vue.js

This repository contains the code for a reusable line chart component written in D3.js and Vue.js. Instead of re-writing the chart from scratch each time you build an interactive chart, use this one as a starting point and customize it when you require even more interactivity.

It comes with:
- data bindings to x-axis, y-axis and colors
- zooming
- panning
- annotation markers

Instead of filling the chart with data on the president's approval ratings, you could just go ahead and put in time series data on electricity prices. Instead of re-reading the documentation on D3 each time that you want to add a title on a chart, you can easily pass title texts as opts to the chart component.

## Installation
Install from npm:
> npm i @maxthemillion/vued3-linechart

Import to your main.js: 
> import app from '@maxthemillion/vued3-linechart'

## opts arguments
The opts object of the Linechart component takes the following arguments:
- dataURL: relative path to the data in csv format (eg. "./data/approval_allpolls.csv")
- chartTitle: string (eg. "How unpopular is Donald Trump?")
- chartSubTitle: string (eg. "Share of respondents disapproving the president (in %)")
- commentTitle: string that becomes the title for the chart's comment (eg. "The unwanted president")
- comment: string that explains the content of the chart in more detail
- binding: object with the following properties { 
    - x: heading of the data to map on the x-axis
    - y: heading of the data to map on the y-axis 
    - color: heading of the data to map to colors
    }
- xAxisTitle: string, null for no title
- yAxisTitle: string, null for no title
- colorScheme: d3-color scheme such as d3.schemeTableau10
- annotations: array of objects in the format {x: ... , text: ...}
npm package: @maxtrader/backtest-browser-runtime
Description: Browser-oriented async runtime around core engine using a Web Worker.
Latest version: 0.1.1

# @maxtrader/backtest-browser-runtime

Browser-oriented async runtime around core engine using a Web Worker.

## Purpose

- Keeps heavy replay/analytics logic off the main thread.
- Exposes `AsyncBacktestEngine` for UI integration.
- Provides sync orchestration, screenshot, zip export, and live bridge helpers.

## Key Exports

- `createBrowserBacktestEngine`
- `bindReplayToVisualChart`, `bindReplayToVisualCharts`
- `createReplaySyncOrchestrator`
- `ScreenshotCaptureService`
- `exportScreenshotsToZipStream`
- `createLiveTradingBridge`
- `BrowserBacktestEngine#linkVisualEngine` (two-way SL/TP sync with visual drawings)

## Minimal Usage

```ts
import { createBrowserBacktestEngine } from "@maxtrader/backtest-browser-runtime";

const engine = createBrowserBacktestEngine({
  symbol: "EURUSD",
  timeframe: "M1",
  initialBalance: 10_000,
  seed: 0
});

await engine.loadDataset(dataset);
await engine.step(1);
console.log(await engine.getState());
```

## Live Bridge Notes

Live bridge is guard-first and requires explicit enable flow:

```ts
import { createLiveTradingBridge } from "@maxtrader/backtest-browser-runtime";

const bridge = createLiveTradingBridge(engine, {
  riskGuards: { enableLiveMode: true }
});
```

See `docs/build-trading-app.md` and `docs/security-and-risk.md`.
npm package: @maxtrader/backtest-core
Description: Deterministic simulation engine implementation.
Latest version: 0.1.1

# @maxtrader/backtest-core

Deterministic simulation engine implementation.

## Purpose

- Executes replay, order matching, risk rules, and journaling.
- Produces deterministic snapshots and analytics.
- Provides core primitives for parity and deterministic testing.

## Key Exports

- `createBacktestEngine`
- `BacktestEngineImpl`
- `DeterministicPaperBrokerAdapter`
- `runBacktestPaperParity`
- determinism utilities: `round8`, `stableHash`, `stableObjectHash`
- analytics utilities and memory planning helpers

## Minimal Usage

```ts
import { createBacktestEngine } from "@maxtrader/backtest-core";

const engine = createBacktestEngine({
  symbol: "EURUSD",
  timeframe: "M1",
  initialBalance: 10_000,
  seed: 0
});

engine.loadDataset(dataset);
engine.step(100);

const state = engine.getState();
const snapshot = engine.computeDeterminismSnapshot("core-run");
```

## Integration Notes

- Use `@maxtrader/backtest-browser-runtime` for browser UI apps.
- Core is sync API; browser runtime wraps it as async worker API.
- Keep determinism constraints intact when extending engine internals.
npm package: @maxtrader/backtest-csv-loader
Description: Strict CSV ingestion and normalization for deterministic datasets.
Latest version: 0.1.1

# @maxtrader/backtest-csv-loader

Strict CSV ingestion and normalization for deterministic datasets.

## Purpose

- Parse candle CSV text.
- Validate required columns and numeric/timestamp integrity.
- Normalize timestamps to epoch milliseconds.
- Stable sort rows by `tOpen` with original-row tie breaker.

## API

```ts
import { loadCandlesFromCsv } from "@maxtrader/backtest-csv-loader";

const dataset = loadCandlesFromCsv(csvText, {
  symbol: "EURUSD",
  timeframe: "M1"
});
```

## Required Columns

- `tOpen`
- `tClose`
- `open`
- `high`
- `low`
- `close`
- `volume`

## Validation Rules

- `tOpen <= tClose`
- `high >= max(open, close)`
- `low <= min(open, close)`
- row width must match header width
npm package: @maxtrader/backtest-persistence-idb
Description: IndexedDB persistence adapters for journal entries and screenshots.
Latest version: 0.1.1

# @maxtrader/backtest-persistence-idb

IndexedDB persistence adapters for journal entries and screenshots.

## Purpose

- Provide browser persistence implementation of protocol adapter interfaces.
- Keep journal and screenshot storage deterministic and replay-friendly.

## Exports

- `IndexedDbJournalStore`
- `IndexedDbScreenshotStore`

## Journal Store Usage

```ts
import { IndexedDbJournalStore } from "@maxtrader/backtest-persistence-idb";

const journalStore = new IndexedDbJournalStore({
  dbName: "myapp.backtest",
  storeName: "entries"
});
```

## Screenshot Store Usage

```ts
import { IndexedDbScreenshotStore } from "@maxtrader/backtest-persistence-idb";

const screenshotStore = new IndexedDbScreenshotStore({
  dbName: "myapp.backtest",
  storeName: "screenshots"
});
```

## Notes

- Journal store keys by `seq`.
- Screenshot store keys by screenshot reference `id`.
- `readRefs()` returns references sorted by `cursor`, `ts`, then `id`.
npm package: @maxtrader/backtest-protocol
Description: Shared public contracts for the MaxTrader backtesting engine workspace.
Latest version: 0.1.1

# @maxtrader/backtest-protocol

Shared public contracts for the MaxTrader backtesting engine workspace.

## Purpose

- Defines core engine interfaces and runtime contracts.
- Provides type-safe shared models across core, browser runtime, and adapters.
- Acts as the API boundary for integrators and contributors.

## Key Exports

- engine interfaces: `BacktestEngine`, `AsyncBacktestEngine`
- runtime config/state: `BacktestEngineConfig`, `BacktestState`
- events: `BacktestEventType`, `BacktestEvent`
- execution/accounting/journal types
- analytics and Monte Carlo request/result types
- broker and mode contracts (`BacktestMode`, `BrokerAdapter`, `BrokerRiskGuards`)
- visual link contracts (`VisualEngineLinkAdapter`, drawing SL/TP sync types)

## Example

```ts
import type { BacktestEngineConfig, OrderRequest } from "@maxtrader/backtest-protocol";

const config: BacktestEngineConfig = {
  symbol: "EURUSD",
  timeframe: "M1",
  initialBalance: 10_000,
  seed: 0
};

const order: OrderRequest = {
  type: "MARKET",
  side: "BUY",
  lots: 0.1
};
```

## Notes

- Prefer additive changes to maintain compatibility.
- Keep protocol updates synchronized with `docs/api-reference.md`.