@alphacharts/core 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +40 -2
- package/dist/index.js +3769 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.js +7 -0
- package/dist/internal.js.map +1 -0
- package/dist/types/chart/chart.d.ts +348 -0
- package/dist/types/chart/dashboard.d.ts +19 -0
- package/dist/types/chart/emitter.d.ts +10 -0
- package/dist/types/chart/layers.d.ts +73 -0
- package/dist/types/chart/layout.d.ts +61 -0
- package/dist/types/chart/markers.d.ts +63 -0
- package/dist/types/chart/messages.d.ts +18 -0
- package/dist/types/chart/plugin.d.ts +75 -0
- package/dist/types/chart/primitives.d.ts +119 -0
- package/dist/types/chart/scheduler.d.ts +9 -0
- package/dist/types/chart/series-types.d.ts +79 -0
- package/dist/types/chart/series.d.ts +81 -0
- package/dist/types/chart/theme.d.ts +26 -0
- package/dist/types/chart/watermark.d.ts +10 -0
- package/dist/types/data/deque.d.ts +39 -0
- package/dist/types/data/lod.d.ts +40 -0
- package/dist/types/data/model.d.ts +132 -0
- package/dist/types/data/resample.d.ts +59 -0
- package/dist/types/data/session.d.ts +36 -0
- package/dist/types/data/timeline.d.ts +29 -0
- package/dist/types/data/tz.d.ts +27 -0
- package/dist/types/fault.d.ts +9 -0
- package/dist/types/feed/datafeed.d.ts +65 -0
- package/dist/types/index.d.ts +52 -0
- package/dist/types/interaction/input.d.ts +32 -0
- package/dist/types/interaction/sync.d.ts +13 -0
- package/dist/types/internal.d.ts +6 -0
- package/dist/types/render/canvas2d.d.ts +43 -0
- package/dist/types/render/color.d.ts +4 -0
- package/dist/types/render/gl.d.ts +14 -0
- package/dist/types/render/renderers.d.ts +103 -0
- package/dist/types/render/surface.d.ts +43 -0
- package/dist/types/render/window.d.ts +54 -0
- package/dist/types/scale/format.d.ts +28 -0
- package/dist/types/scale/price-scale.d.ts +60 -0
- package/dist/types/scale/ticks.d.ts +82 -0
- package/dist/types/scale/time-scale.d.ts +51 -0
- package/dist/types/version.d.ts +1 -0
- package/dist/window-WvcPCDkK.js +969 -0
- package/dist/window-WvcPCDkK.js.map +1 -0
- package/package.json +53 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alphabench
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @alphacharts/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The alphacharts engine: WebGL2 series (candles, line, area, histogram, ...), Canvas2D text, panes, price and time
|
|
4
|
+
scales, crosshair, markers, price lines, synced charts and a datafeed driver. No runtime dependencies. WebGL2 is
|
|
5
|
+
used when available, with a Canvas2D fallback (`renderer: "auto" | "webgl" | "canvas2d"`).
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install @alphacharts/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { createChart } from "@alphacharts/core";
|
|
13
|
+
|
|
14
|
+
const chart = createChart(el, { theme: "dark", timeZone: "UTC" });
|
|
15
|
+
const candles = chart.addSeries("candles", { priceFormat: { type: "price", minMove: 0.05 } });
|
|
16
|
+
candles.setData(bars); // [{ time, open, high, low, close }], time in UTC ms
|
|
17
|
+
candles.update(bar); // live: same time replaces, later time appends
|
|
18
|
+
chart.createPriceLine(candles, { price: 100, title: "target" });
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Colour individual candles or bars, and shade a pane's background per bar:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
candles.setBarColors({ time: Float64Array.of(t1, t2), color: Uint32Array.of(0xffd835ff, 0) }); // 0xRRGGBBAA, 0 = the up/down colours
|
|
25
|
+
candles.clearBarColors(); // exactly as before, column and all
|
|
26
|
+
candles.attachPrimitive(new BarShading()); // .set(times, colors) / .setAt(time, color): behind the series, no part in autoscale
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A bar's colour belongs to (series, time): `update`, `prepend` and `setData` keep the colours of the bars they keep, `OhlcBar.color` and
|
|
30
|
+
`ColumnarOhlc.color` set them from the data. The colour column is added to the store, and to the level-of-detail pyramid (a bucket takes the last coloured
|
|
31
|
+
bar's colour), the first time a colour is written; a series never coloured has no such column, and its candle and bar shaders do one
|
|
32
|
+
integer compare per vertex on the colour slot every GPU record already carries (no added buffer). A value series' points
|
|
33
|
+
may carry their own colour too (`ValuePoint.color`), which the line renderers draw per segment (the colour of the point the segment arrives at), in WebGL and Canvas2D.
|
|
34
|
+
`DataChange.kind` has a new value, `"color"`, announced to renderers only: plugins such as studies are not told, because nothing they follow moved.
|
|
35
|
+
|
|
36
|
+
Hide the Alphabench brand mark with `createChart(el, { watermark: { visible: false } })`.
|
|
37
|
+
|
|
38
|
+
`@alphacharts/core/internal` exposes rendering internals for the sibling series packages (`chart-types`,
|
|
39
|
+
`orderflow`). It is not public API and changes without notice.
|
|
40
|
+
|
|
41
|
+
See the [repository README](https://github.com/alphabench/alphacharts#readme) for the full guide. MIT licence.
|