@revivejs/react-highcharts 17.0.0
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 +142 -0
- package/dist/index.cjs +143 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alexandro Marques
|
|
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
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# @revivejs/react-highcharts
|
|
2
|
+
|
|
3
|
+
> A maintained **React 17 wrapper for Highcharts** with a thin component API, imperative ref access, `stockChart` support, and versioned live demos.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@revivejs/react-highcharts)
|
|
6
|
+
[](https://www.npmjs.com/package/@revivejs/react-highcharts)
|
|
7
|
+
[](https://github.com/alexandroit/react-highcharts/blob/master/LICENSE)
|
|
8
|
+
[](https://react.dev)
|
|
9
|
+
[](https://www.highcharts.com)
|
|
10
|
+
|
|
11
|
+
**[Documentation & Live Demos](https://alexandroit.github.io/react-highcharts/)** | **[npm](https://www.npmjs.com/package/@revivejs/react-highcharts)** | **[Issues](https://github.com/alexandroit/react-highcharts/issues)** | **[Repository](https://github.com/alexandroit/react-highcharts)**
|
|
12
|
+
|
|
13
|
+
**Latest version:** `17.0.0`
|
|
14
|
+
|
|
15
|
+
## Why this library?
|
|
16
|
+
|
|
17
|
+
`@revivejs/react-highcharts` is intentionally thin. It follows the common React + Highcharts pattern:
|
|
18
|
+
|
|
19
|
+
- pass a `highcharts` instance
|
|
20
|
+
- pass a single `options` object
|
|
21
|
+
- choose the constructor with `constructorType`
|
|
22
|
+
- access the live chart through a ref when you need imperative updates
|
|
23
|
+
|
|
24
|
+
That makes it easy to keep React in charge of composition while still using the full Highcharts API.
|
|
25
|
+
|
|
26
|
+
## React Version Compatibility
|
|
27
|
+
|
|
28
|
+
| Package version | React version | Highcharts version | Demo link |
|
|
29
|
+
| :---: | :---: | :---: | :--- |
|
|
30
|
+
| **17.0.0** | **17.0.x** | **12.5.x** | [React 17 demo](https://alexandroit.github.io/react-highcharts/react-17/) |
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @revivejs/react-highcharts highcharts
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Basic Usage
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import Highcharts from 'highcharts';
|
|
42
|
+
import { Chart } from '@revivejs/react-highcharts';
|
|
43
|
+
|
|
44
|
+
const options: Highcharts.Options = {
|
|
45
|
+
title: { text: 'Quarterly revenue' },
|
|
46
|
+
series: [
|
|
47
|
+
{
|
|
48
|
+
type: 'line',
|
|
49
|
+
name: 'Revenue',
|
|
50
|
+
data: [14, 18, 22, 28]
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export function RevenueChart() {
|
|
56
|
+
return <Chart highcharts={Highcharts} options={options} />;
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## StockChart
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import Highcharts from 'highcharts/highstock';
|
|
64
|
+
import { Chart } from '@revivejs/react-highcharts';
|
|
65
|
+
|
|
66
|
+
export function PriceChart() {
|
|
67
|
+
return (
|
|
68
|
+
<Chart
|
|
69
|
+
highcharts={Highcharts}
|
|
70
|
+
constructorType="stockChart"
|
|
71
|
+
options={{
|
|
72
|
+
series: [{ type: 'line', data: [101, 104, 109, 111] }]
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Modules
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import Highcharts from 'highcharts';
|
|
83
|
+
import {
|
|
84
|
+
Chart,
|
|
85
|
+
exposeHighchartsGlobals,
|
|
86
|
+
initHighchartsModules
|
|
87
|
+
} from '@revivejs/react-highcharts';
|
|
88
|
+
|
|
89
|
+
exposeHighchartsGlobals(Highcharts);
|
|
90
|
+
|
|
91
|
+
const [{ default: Highcharts3D }, { default: HeatmapModule }] = await Promise.all([
|
|
92
|
+
import('highcharts/highcharts-3d.js'),
|
|
93
|
+
import('highcharts/modules/heatmap.js')
|
|
94
|
+
]);
|
|
95
|
+
|
|
96
|
+
initHighchartsModules(Highcharts, Highcharts3D, HeatmapModule);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Imperative Access
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
import { useRef } from 'react';
|
|
103
|
+
import Highcharts from 'highcharts';
|
|
104
|
+
import { Chart, type ChartHandle } from '@revivejs/react-highcharts';
|
|
105
|
+
|
|
106
|
+
export function ControlledChart() {
|
|
107
|
+
const chartRef = useRef<ChartHandle>(null);
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<button
|
|
112
|
+
onClick={() => {
|
|
113
|
+
chartRef.current?.chart?.series[0]?.addPoint(42);
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
Add point
|
|
117
|
+
</button>
|
|
118
|
+
<Chart ref={chartRef} highcharts={Highcharts} options={{ series: [{ type: 'line', data: [10, 12, 16] }] }} />
|
|
119
|
+
</>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## API
|
|
125
|
+
|
|
126
|
+
| Prop | Type | Notes |
|
|
127
|
+
| :--- | :--- | :--- |
|
|
128
|
+
| `highcharts` | `typeof Highcharts` | Required. Pass the instance or bundle you want to use. |
|
|
129
|
+
| `options` | `Highcharts.Options` | Required. Passed into the selected Highcharts constructor. |
|
|
130
|
+
| `constructorType` | `'chart' \| 'stockChart' \| 'mapChart' \| 'ganttChart'` | Defaults to `'chart'`. |
|
|
131
|
+
| `onChartReady` | `(chart) => void` | Called after the chart is created. |
|
|
132
|
+
| `allowChartUpdate` | `boolean` | Defaults to `true`. |
|
|
133
|
+
| `immutable` | `boolean` | Recreates the chart instead of calling `chart.update`. |
|
|
134
|
+
| `updateArgs` | `[redraw, oneToOne, animation]` | Forwarded to `chart.update`. |
|
|
135
|
+
| `containerProps` | `HTMLAttributes<HTMLDivElement>` | Additional props for the chart container. |
|
|
136
|
+
|
|
137
|
+
## Changelog
|
|
138
|
+
|
|
139
|
+
### 17.0.0
|
|
140
|
+
- Initial React wrapper line
|
|
141
|
+
- Added the first versioned docs app for React 17
|
|
142
|
+
- Established the versioned docs structure used by later releases
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Chart: () => Chart,
|
|
24
|
+
exposeHighchartsGlobals: () => exposeHighchartsGlobals,
|
|
25
|
+
initHighchartsModules: () => initHighchartsModules
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
|
|
29
|
+
// src/Chart.tsx
|
|
30
|
+
var import_react2 = require("react");
|
|
31
|
+
|
|
32
|
+
// src/useIsomorphicLayoutEffect.ts
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect;
|
|
35
|
+
|
|
36
|
+
// src/Chart.tsx
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var Chart = (0, import_react2.forwardRef)(function Chart2({
|
|
39
|
+
highcharts,
|
|
40
|
+
options,
|
|
41
|
+
constructorType = "chart",
|
|
42
|
+
onChartReady,
|
|
43
|
+
allowChartUpdate = true,
|
|
44
|
+
immutable = false,
|
|
45
|
+
updateArgs = [true, true, true],
|
|
46
|
+
containerProps
|
|
47
|
+
}, ref) {
|
|
48
|
+
const containerRef = (0, import_react2.useRef)(null);
|
|
49
|
+
const chartRef = (0, import_react2.useRef)(null);
|
|
50
|
+
const skipNextUpdateRef = (0, import_react2.useRef)(true);
|
|
51
|
+
const onReadyRef = (0, import_react2.useRef)(onChartReady);
|
|
52
|
+
onReadyRef.current = onChartReady;
|
|
53
|
+
(0, import_react2.useImperativeHandle)(
|
|
54
|
+
ref,
|
|
55
|
+
() => ({
|
|
56
|
+
chart: chartRef.current,
|
|
57
|
+
container: containerRef.current
|
|
58
|
+
}),
|
|
59
|
+
[]
|
|
60
|
+
);
|
|
61
|
+
function destroyChart() {
|
|
62
|
+
chartRef.current?.destroy();
|
|
63
|
+
chartRef.current = null;
|
|
64
|
+
}
|
|
65
|
+
function createChart() {
|
|
66
|
+
if (!containerRef.current) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const factory = highcharts[constructorType];
|
|
70
|
+
if (typeof factory !== "function") {
|
|
71
|
+
throw new Error(
|
|
72
|
+
`Unknown Highcharts constructor "${constructorType}". Make sure you passed the right Highcharts bundle.`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
destroyChart();
|
|
76
|
+
chartRef.current = factory(containerRef.current, options, (chart) => {
|
|
77
|
+
onReadyRef.current?.(chart);
|
|
78
|
+
});
|
|
79
|
+
skipNextUpdateRef.current = true;
|
|
80
|
+
}
|
|
81
|
+
useIsomorphicLayoutEffect(() => {
|
|
82
|
+
createChart();
|
|
83
|
+
return () => {
|
|
84
|
+
destroyChart();
|
|
85
|
+
};
|
|
86
|
+
}, [highcharts, constructorType]);
|
|
87
|
+
useIsomorphicLayoutEffect(() => {
|
|
88
|
+
const chart = chartRef.current;
|
|
89
|
+
if (!chart) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (skipNextUpdateRef.current) {
|
|
93
|
+
skipNextUpdateRef.current = false;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (immutable) {
|
|
97
|
+
createChart();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!allowChartUpdate) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
chart.update(options, updateArgs[0], updateArgs[1], updateArgs[2]);
|
|
104
|
+
}, [
|
|
105
|
+
options,
|
|
106
|
+
allowChartUpdate,
|
|
107
|
+
immutable,
|
|
108
|
+
updateArgs[0],
|
|
109
|
+
updateArgs[1],
|
|
110
|
+
updateArgs[2]
|
|
111
|
+
]);
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...containerProps, ref: containerRef });
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// src/modules.ts
|
|
116
|
+
var appliedModules = /* @__PURE__ */ new WeakMap();
|
|
117
|
+
function exposeHighchartsGlobals(highcharts) {
|
|
118
|
+
const scope = globalThis;
|
|
119
|
+
scope.Highcharts = highcharts;
|
|
120
|
+
scope._Highcharts = highcharts;
|
|
121
|
+
}
|
|
122
|
+
function initHighchartsModules(highcharts, ...modules) {
|
|
123
|
+
exposeHighchartsGlobals(highcharts);
|
|
124
|
+
const registry = appliedModules.get(highcharts) ?? /* @__PURE__ */ new Set();
|
|
125
|
+
for (const entry of modules) {
|
|
126
|
+
const factory = entry.default ?? entry;
|
|
127
|
+
if (registry.has(factory)) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (typeof factory === "function") {
|
|
131
|
+
factory(highcharts);
|
|
132
|
+
registry.add(factory);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
appliedModules.set(highcharts, registry);
|
|
136
|
+
}
|
|
137
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
138
|
+
0 && (module.exports = {
|
|
139
|
+
Chart,
|
|
140
|
+
exposeHighchartsGlobals,
|
|
141
|
+
initHighchartsModules
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Chart.tsx","../src/useIsomorphicLayoutEffect.ts","../src/modules.ts"],"sourcesContent":["export { Chart } from './Chart';\nexport type { ChartHandle, ChartProps, ConstructorType } from './Chart';\nexport { exposeHighchartsGlobals, initHighchartsModules } from './modules';\nexport type { HighchartsModuleFactory } from './modules';\n","import type Highcharts from 'highcharts';\nimport {\n forwardRef,\n useImperativeHandle,\n useRef,\n type HTMLAttributes\n} from 'react';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\nexport type ConstructorType = 'chart' | 'stockChart' | 'mapChart' | 'ganttChart';\n\nexport interface ChartHandle {\n chart: Highcharts.Chart | null;\n container: HTMLDivElement | null;\n}\n\nexport interface ChartProps {\n highcharts: typeof Highcharts;\n options: Highcharts.Options;\n constructorType?: ConstructorType;\n onChartReady?: (chart: Highcharts.Chart) => void;\n allowChartUpdate?: boolean;\n immutable?: boolean;\n updateArgs?: [\n redraw?: boolean,\n oneToOne?: boolean,\n animation?: boolean | Partial<Highcharts.AnimationOptionsObject>\n ];\n containerProps?: HTMLAttributes<HTMLDivElement>;\n}\n\nexport const Chart = forwardRef<ChartHandle, ChartProps>(function Chart(\n {\n highcharts,\n options,\n constructorType = 'chart',\n onChartReady,\n allowChartUpdate = true,\n immutable = false,\n updateArgs = [true, true, true],\n containerProps\n },\n ref\n) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const chartRef = useRef<Highcharts.Chart | null>(null);\n const skipNextUpdateRef = useRef(true);\n const onReadyRef = useRef(onChartReady);\n\n onReadyRef.current = onChartReady;\n\n useImperativeHandle(\n ref,\n () => ({\n chart: chartRef.current,\n container: containerRef.current\n }),\n []\n );\n\n function destroyChart() {\n chartRef.current?.destroy();\n chartRef.current = null;\n }\n\n function createChart() {\n if (!containerRef.current) {\n return;\n }\n\n const factory = (highcharts as unknown as Record<string, unknown>)[constructorType];\n\n if (typeof factory !== 'function') {\n throw new Error(\n `Unknown Highcharts constructor \"${constructorType}\". ` +\n 'Make sure you passed the right Highcharts bundle.'\n );\n }\n\n destroyChart();\n\n chartRef.current = (\n factory as (\n container: HTMLElement,\n options: Highcharts.Options,\n callback?: (chart: Highcharts.Chart) => void\n ) => Highcharts.Chart\n )(containerRef.current, options, (chart) => {\n onReadyRef.current?.(chart);\n });\n\n skipNextUpdateRef.current = true;\n }\n\n useIsomorphicLayoutEffect(() => {\n createChart();\n\n return () => {\n destroyChart();\n };\n }, [highcharts, constructorType]);\n\n useIsomorphicLayoutEffect(() => {\n const chart = chartRef.current;\n\n if (!chart) {\n return;\n }\n\n if (skipNextUpdateRef.current) {\n skipNextUpdateRef.current = false;\n return;\n }\n\n if (immutable) {\n createChart();\n return;\n }\n\n if (!allowChartUpdate) {\n return;\n }\n\n chart.update(options, updateArgs[0], updateArgs[1], updateArgs[2]);\n }, [\n options,\n allowChartUpdate,\n immutable,\n updateArgs[0],\n updateArgs[1],\n updateArgs[2]\n ]);\n\n return <div {...containerProps} ref={containerRef} />;\n});\n","import { useEffect, useLayoutEffect } from 'react';\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n","import type Highcharts from 'highcharts';\n\nexport type HighchartsModuleFactory =\n | ((highcharts: typeof Highcharts) => void)\n | { default?: (highcharts: typeof Highcharts) => void };\n\ntype HighchartsGlobalScope = typeof globalThis & {\n Highcharts?: typeof Highcharts;\n _Highcharts?: typeof Highcharts;\n};\n\nconst appliedModules = new WeakMap<object, Set<unknown>>();\n\nexport function exposeHighchartsGlobals(highcharts: typeof Highcharts) {\n const scope = globalThis as HighchartsGlobalScope;\n\n scope.Highcharts = highcharts;\n scope._Highcharts = highcharts;\n}\n\nexport function initHighchartsModules(\n highcharts: typeof Highcharts,\n ...modules: HighchartsModuleFactory[]\n) {\n exposeHighchartsGlobals(highcharts);\n\n const registry = appliedModules.get(highcharts) ?? new Set<unknown>();\n\n for (const entry of modules) {\n const factory = (entry as { default?: (highcharts: typeof Highcharts) => void }).default ?? entry;\n\n if (registry.has(factory)) {\n continue;\n }\n\n if (typeof factory === 'function') {\n factory(highcharts);\n registry.add(factory);\n }\n }\n\n appliedModules.set(highcharts, registry);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,gBAKO;;;ACNP,mBAA2C;AAEpC,IAAM,4BACX,OAAO,WAAW,cAAc,+BAAkB;;;ADkI3C;AAtGF,IAAM,YAAQ,0BAAoC,SAASC,OAChE;AAAA,EACE;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,aAAa,CAAC,MAAM,MAAM,IAAI;AAAA,EAC9B;AACF,GACA,KACA;AACA,QAAM,mBAAe,sBAA8B,IAAI;AACvD,QAAM,eAAW,sBAAgC,IAAI;AACrD,QAAM,wBAAoB,sBAAO,IAAI;AACrC,QAAM,iBAAa,sBAAO,YAAY;AAEtC,aAAW,UAAU;AAErB;AAAA,IACE;AAAA,IACA,OAAO;AAAA,MACL,OAAO,SAAS;AAAA,MAChB,WAAW,aAAa;AAAA,IAC1B;AAAA,IACA,CAAC;AAAA,EACH;AAEA,WAAS,eAAe;AACtB,aAAS,SAAS,QAAQ;AAC1B,aAAS,UAAU;AAAA,EACrB;AAEA,WAAS,cAAc;AACrB,QAAI,CAAC,aAAa,SAAS;AACzB;AAAA,IACF;AAEA,UAAM,UAAW,WAAkD,eAAe;AAElF,QAAI,OAAO,YAAY,YAAY;AACjC,YAAM,IAAI;AAAA,QACR,mCAAmC,eAAe;AAAA,MAEpD;AAAA,IACF;AAEA,iBAAa;AAEb,aAAS,UACP,QAKA,aAAa,SAAS,SAAS,CAAC,UAAU;AAC1C,iBAAW,UAAU,KAAK;AAAA,IAC5B,CAAC;AAED,sBAAkB,UAAU;AAAA,EAC9B;AAEA,4BAA0B,MAAM;AAC9B,gBAAY;AAEZ,WAAO,MAAM;AACX,mBAAa;AAAA,IACf;AAAA,EACF,GAAG,CAAC,YAAY,eAAe,CAAC;AAEhC,4BAA0B,MAAM;AAC9B,UAAM,QAAQ,SAAS;AAEvB,QAAI,CAAC,OAAO;AACV;AAAA,IACF;AAEA,QAAI,kBAAkB,SAAS;AAC7B,wBAAkB,UAAU;AAC5B;AAAA,IACF;AAEA,QAAI,WAAW;AACb,kBAAY;AACZ;AAAA,IACF;AAEA,QAAI,CAAC,kBAAkB;AACrB;AAAA,IACF;AAEA,UAAM,OAAO,SAAS,WAAW,CAAC,GAAG,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC;AAAA,EACnE,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,CAAC;AAAA,IACZ,WAAW,CAAC;AAAA,IACZ,WAAW,CAAC;AAAA,EACd,CAAC;AAED,SAAO,4CAAC,SAAK,GAAG,gBAAgB,KAAK,cAAc;AACrD,CAAC;;;AE3HD,IAAM,iBAAiB,oBAAI,QAA8B;AAElD,SAAS,wBAAwB,YAA+B;AACrE,QAAM,QAAQ;AAEd,QAAM,aAAa;AACnB,QAAM,cAAc;AACtB;AAEO,SAAS,sBACd,eACG,SACH;AACA,0BAAwB,UAAU;AAElC,QAAM,WAAW,eAAe,IAAI,UAAU,KAAK,oBAAI,IAAa;AAEpE,aAAW,SAAS,SAAS;AAC3B,UAAM,UAAW,MAAgE,WAAW;AAE5F,QAAI,SAAS,IAAI,OAAO,GAAG;AACzB;AAAA,IACF;AAEA,QAAI,OAAO,YAAY,YAAY;AACjC,cAAQ,UAAU;AAClB,eAAS,IAAI,OAAO;AAAA,IACtB;AAAA,EACF;AAEA,iBAAe,IAAI,YAAY,QAAQ;AACzC;","names":["import_react","Chart"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import Highcharts from 'highcharts';
|
|
4
|
+
|
|
5
|
+
type ConstructorType = 'chart' | 'stockChart' | 'mapChart' | 'ganttChart';
|
|
6
|
+
interface ChartHandle {
|
|
7
|
+
chart: Highcharts.Chart | null;
|
|
8
|
+
container: HTMLDivElement | null;
|
|
9
|
+
}
|
|
10
|
+
interface ChartProps {
|
|
11
|
+
highcharts: typeof Highcharts;
|
|
12
|
+
options: Highcharts.Options;
|
|
13
|
+
constructorType?: ConstructorType;
|
|
14
|
+
onChartReady?: (chart: Highcharts.Chart) => void;
|
|
15
|
+
allowChartUpdate?: boolean;
|
|
16
|
+
immutable?: boolean;
|
|
17
|
+
updateArgs?: [
|
|
18
|
+
redraw?: boolean,
|
|
19
|
+
oneToOne?: boolean,
|
|
20
|
+
animation?: boolean | Partial<Highcharts.AnimationOptionsObject>
|
|
21
|
+
];
|
|
22
|
+
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
}
|
|
24
|
+
declare const Chart: react.ForwardRefExoticComponent<ChartProps & react.RefAttributes<ChartHandle>>;
|
|
25
|
+
|
|
26
|
+
type HighchartsModuleFactory = ((highcharts: typeof Highcharts) => void) | {
|
|
27
|
+
default?: (highcharts: typeof Highcharts) => void;
|
|
28
|
+
};
|
|
29
|
+
declare function exposeHighchartsGlobals(highcharts: typeof Highcharts): void;
|
|
30
|
+
declare function initHighchartsModules(highcharts: typeof Highcharts, ...modules: HighchartsModuleFactory[]): void;
|
|
31
|
+
|
|
32
|
+
export { Chart, type ChartHandle, type ChartProps, type ConstructorType, type HighchartsModuleFactory, exposeHighchartsGlobals, initHighchartsModules };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import Highcharts from 'highcharts';
|
|
4
|
+
|
|
5
|
+
type ConstructorType = 'chart' | 'stockChart' | 'mapChart' | 'ganttChart';
|
|
6
|
+
interface ChartHandle {
|
|
7
|
+
chart: Highcharts.Chart | null;
|
|
8
|
+
container: HTMLDivElement | null;
|
|
9
|
+
}
|
|
10
|
+
interface ChartProps {
|
|
11
|
+
highcharts: typeof Highcharts;
|
|
12
|
+
options: Highcharts.Options;
|
|
13
|
+
constructorType?: ConstructorType;
|
|
14
|
+
onChartReady?: (chart: Highcharts.Chart) => void;
|
|
15
|
+
allowChartUpdate?: boolean;
|
|
16
|
+
immutable?: boolean;
|
|
17
|
+
updateArgs?: [
|
|
18
|
+
redraw?: boolean,
|
|
19
|
+
oneToOne?: boolean,
|
|
20
|
+
animation?: boolean | Partial<Highcharts.AnimationOptionsObject>
|
|
21
|
+
];
|
|
22
|
+
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
}
|
|
24
|
+
declare const Chart: react.ForwardRefExoticComponent<ChartProps & react.RefAttributes<ChartHandle>>;
|
|
25
|
+
|
|
26
|
+
type HighchartsModuleFactory = ((highcharts: typeof Highcharts) => void) | {
|
|
27
|
+
default?: (highcharts: typeof Highcharts) => void;
|
|
28
|
+
};
|
|
29
|
+
declare function exposeHighchartsGlobals(highcharts: typeof Highcharts): void;
|
|
30
|
+
declare function initHighchartsModules(highcharts: typeof Highcharts, ...modules: HighchartsModuleFactory[]): void;
|
|
31
|
+
|
|
32
|
+
export { Chart, type ChartHandle, type ChartProps, type ConstructorType, type HighchartsModuleFactory, exposeHighchartsGlobals, initHighchartsModules };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// src/Chart.tsx
|
|
2
|
+
import {
|
|
3
|
+
forwardRef,
|
|
4
|
+
useImperativeHandle,
|
|
5
|
+
useRef
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
// src/useIsomorphicLayoutEffect.ts
|
|
9
|
+
import { useEffect, useLayoutEffect } from "react";
|
|
10
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
11
|
+
|
|
12
|
+
// src/Chart.tsx
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var Chart = forwardRef(function Chart2({
|
|
15
|
+
highcharts,
|
|
16
|
+
options,
|
|
17
|
+
constructorType = "chart",
|
|
18
|
+
onChartReady,
|
|
19
|
+
allowChartUpdate = true,
|
|
20
|
+
immutable = false,
|
|
21
|
+
updateArgs = [true, true, true],
|
|
22
|
+
containerProps
|
|
23
|
+
}, ref) {
|
|
24
|
+
const containerRef = useRef(null);
|
|
25
|
+
const chartRef = useRef(null);
|
|
26
|
+
const skipNextUpdateRef = useRef(true);
|
|
27
|
+
const onReadyRef = useRef(onChartReady);
|
|
28
|
+
onReadyRef.current = onChartReady;
|
|
29
|
+
useImperativeHandle(
|
|
30
|
+
ref,
|
|
31
|
+
() => ({
|
|
32
|
+
chart: chartRef.current,
|
|
33
|
+
container: containerRef.current
|
|
34
|
+
}),
|
|
35
|
+
[]
|
|
36
|
+
);
|
|
37
|
+
function destroyChart() {
|
|
38
|
+
chartRef.current?.destroy();
|
|
39
|
+
chartRef.current = null;
|
|
40
|
+
}
|
|
41
|
+
function createChart() {
|
|
42
|
+
if (!containerRef.current) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const factory = highcharts[constructorType];
|
|
46
|
+
if (typeof factory !== "function") {
|
|
47
|
+
throw new Error(
|
|
48
|
+
`Unknown Highcharts constructor "${constructorType}". Make sure you passed the right Highcharts bundle.`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
destroyChart();
|
|
52
|
+
chartRef.current = factory(containerRef.current, options, (chart) => {
|
|
53
|
+
onReadyRef.current?.(chart);
|
|
54
|
+
});
|
|
55
|
+
skipNextUpdateRef.current = true;
|
|
56
|
+
}
|
|
57
|
+
useIsomorphicLayoutEffect(() => {
|
|
58
|
+
createChart();
|
|
59
|
+
return () => {
|
|
60
|
+
destroyChart();
|
|
61
|
+
};
|
|
62
|
+
}, [highcharts, constructorType]);
|
|
63
|
+
useIsomorphicLayoutEffect(() => {
|
|
64
|
+
const chart = chartRef.current;
|
|
65
|
+
if (!chart) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (skipNextUpdateRef.current) {
|
|
69
|
+
skipNextUpdateRef.current = false;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (immutable) {
|
|
73
|
+
createChart();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!allowChartUpdate) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
chart.update(options, updateArgs[0], updateArgs[1], updateArgs[2]);
|
|
80
|
+
}, [
|
|
81
|
+
options,
|
|
82
|
+
allowChartUpdate,
|
|
83
|
+
immutable,
|
|
84
|
+
updateArgs[0],
|
|
85
|
+
updateArgs[1],
|
|
86
|
+
updateArgs[2]
|
|
87
|
+
]);
|
|
88
|
+
return /* @__PURE__ */ jsx("div", { ...containerProps, ref: containerRef });
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// src/modules.ts
|
|
92
|
+
var appliedModules = /* @__PURE__ */ new WeakMap();
|
|
93
|
+
function exposeHighchartsGlobals(highcharts) {
|
|
94
|
+
const scope = globalThis;
|
|
95
|
+
scope.Highcharts = highcharts;
|
|
96
|
+
scope._Highcharts = highcharts;
|
|
97
|
+
}
|
|
98
|
+
function initHighchartsModules(highcharts, ...modules) {
|
|
99
|
+
exposeHighchartsGlobals(highcharts);
|
|
100
|
+
const registry = appliedModules.get(highcharts) ?? /* @__PURE__ */ new Set();
|
|
101
|
+
for (const entry of modules) {
|
|
102
|
+
const factory = entry.default ?? entry;
|
|
103
|
+
if (registry.has(factory)) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (typeof factory === "function") {
|
|
107
|
+
factory(highcharts);
|
|
108
|
+
registry.add(factory);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
appliedModules.set(highcharts, registry);
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
Chart,
|
|
115
|
+
exposeHighchartsGlobals,
|
|
116
|
+
initHighchartsModules
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Chart.tsx","../src/useIsomorphicLayoutEffect.ts","../src/modules.ts"],"sourcesContent":["import type Highcharts from 'highcharts';\nimport {\n forwardRef,\n useImperativeHandle,\n useRef,\n type HTMLAttributes\n} from 'react';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\nexport type ConstructorType = 'chart' | 'stockChart' | 'mapChart' | 'ganttChart';\n\nexport interface ChartHandle {\n chart: Highcharts.Chart | null;\n container: HTMLDivElement | null;\n}\n\nexport interface ChartProps {\n highcharts: typeof Highcharts;\n options: Highcharts.Options;\n constructorType?: ConstructorType;\n onChartReady?: (chart: Highcharts.Chart) => void;\n allowChartUpdate?: boolean;\n immutable?: boolean;\n updateArgs?: [\n redraw?: boolean,\n oneToOne?: boolean,\n animation?: boolean | Partial<Highcharts.AnimationOptionsObject>\n ];\n containerProps?: HTMLAttributes<HTMLDivElement>;\n}\n\nexport const Chart = forwardRef<ChartHandle, ChartProps>(function Chart(\n {\n highcharts,\n options,\n constructorType = 'chart',\n onChartReady,\n allowChartUpdate = true,\n immutable = false,\n updateArgs = [true, true, true],\n containerProps\n },\n ref\n) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const chartRef = useRef<Highcharts.Chart | null>(null);\n const skipNextUpdateRef = useRef(true);\n const onReadyRef = useRef(onChartReady);\n\n onReadyRef.current = onChartReady;\n\n useImperativeHandle(\n ref,\n () => ({\n chart: chartRef.current,\n container: containerRef.current\n }),\n []\n );\n\n function destroyChart() {\n chartRef.current?.destroy();\n chartRef.current = null;\n }\n\n function createChart() {\n if (!containerRef.current) {\n return;\n }\n\n const factory = (highcharts as unknown as Record<string, unknown>)[constructorType];\n\n if (typeof factory !== 'function') {\n throw new Error(\n `Unknown Highcharts constructor \"${constructorType}\". ` +\n 'Make sure you passed the right Highcharts bundle.'\n );\n }\n\n destroyChart();\n\n chartRef.current = (\n factory as (\n container: HTMLElement,\n options: Highcharts.Options,\n callback?: (chart: Highcharts.Chart) => void\n ) => Highcharts.Chart\n )(containerRef.current, options, (chart) => {\n onReadyRef.current?.(chart);\n });\n\n skipNextUpdateRef.current = true;\n }\n\n useIsomorphicLayoutEffect(() => {\n createChart();\n\n return () => {\n destroyChart();\n };\n }, [highcharts, constructorType]);\n\n useIsomorphicLayoutEffect(() => {\n const chart = chartRef.current;\n\n if (!chart) {\n return;\n }\n\n if (skipNextUpdateRef.current) {\n skipNextUpdateRef.current = false;\n return;\n }\n\n if (immutable) {\n createChart();\n return;\n }\n\n if (!allowChartUpdate) {\n return;\n }\n\n chart.update(options, updateArgs[0], updateArgs[1], updateArgs[2]);\n }, [\n options,\n allowChartUpdate,\n immutable,\n updateArgs[0],\n updateArgs[1],\n updateArgs[2]\n ]);\n\n return <div {...containerProps} ref={containerRef} />;\n});\n","import { useEffect, useLayoutEffect } from 'react';\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n","import type Highcharts from 'highcharts';\n\nexport type HighchartsModuleFactory =\n | ((highcharts: typeof Highcharts) => void)\n | { default?: (highcharts: typeof Highcharts) => void };\n\ntype HighchartsGlobalScope = typeof globalThis & {\n Highcharts?: typeof Highcharts;\n _Highcharts?: typeof Highcharts;\n};\n\nconst appliedModules = new WeakMap<object, Set<unknown>>();\n\nexport function exposeHighchartsGlobals(highcharts: typeof Highcharts) {\n const scope = globalThis as HighchartsGlobalScope;\n\n scope.Highcharts = highcharts;\n scope._Highcharts = highcharts;\n}\n\nexport function initHighchartsModules(\n highcharts: typeof Highcharts,\n ...modules: HighchartsModuleFactory[]\n) {\n exposeHighchartsGlobals(highcharts);\n\n const registry = appliedModules.get(highcharts) ?? new Set<unknown>();\n\n for (const entry of modules) {\n const factory = (entry as { default?: (highcharts: typeof Highcharts) => void }).default ?? entry;\n\n if (registry.has(factory)) {\n continue;\n }\n\n if (typeof factory === 'function') {\n factory(highcharts);\n registry.add(factory);\n }\n }\n\n appliedModules.set(highcharts, registry);\n}\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;;;ACNP,SAAS,WAAW,uBAAuB;AAEpC,IAAM,4BACX,OAAO,WAAW,cAAc,kBAAkB;;;ADkI3C;AAtGF,IAAM,QAAQ,WAAoC,SAASA,OAChE;AAAA,EACE;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,aAAa,CAAC,MAAM,MAAM,IAAI;AAAA,EAC9B;AACF,GACA,KACA;AACA,QAAM,eAAe,OAA8B,IAAI;AACvD,QAAM,WAAW,OAAgC,IAAI;AACrD,QAAM,oBAAoB,OAAO,IAAI;AACrC,QAAM,aAAa,OAAO,YAAY;AAEtC,aAAW,UAAU;AAErB;AAAA,IACE;AAAA,IACA,OAAO;AAAA,MACL,OAAO,SAAS;AAAA,MAChB,WAAW,aAAa;AAAA,IAC1B;AAAA,IACA,CAAC;AAAA,EACH;AAEA,WAAS,eAAe;AACtB,aAAS,SAAS,QAAQ;AAC1B,aAAS,UAAU;AAAA,EACrB;AAEA,WAAS,cAAc;AACrB,QAAI,CAAC,aAAa,SAAS;AACzB;AAAA,IACF;AAEA,UAAM,UAAW,WAAkD,eAAe;AAElF,QAAI,OAAO,YAAY,YAAY;AACjC,YAAM,IAAI;AAAA,QACR,mCAAmC,eAAe;AAAA,MAEpD;AAAA,IACF;AAEA,iBAAa;AAEb,aAAS,UACP,QAKA,aAAa,SAAS,SAAS,CAAC,UAAU;AAC1C,iBAAW,UAAU,KAAK;AAAA,IAC5B,CAAC;AAED,sBAAkB,UAAU;AAAA,EAC9B;AAEA,4BAA0B,MAAM;AAC9B,gBAAY;AAEZ,WAAO,MAAM;AACX,mBAAa;AAAA,IACf;AAAA,EACF,GAAG,CAAC,YAAY,eAAe,CAAC;AAEhC,4BAA0B,MAAM;AAC9B,UAAM,QAAQ,SAAS;AAEvB,QAAI,CAAC,OAAO;AACV;AAAA,IACF;AAEA,QAAI,kBAAkB,SAAS;AAC7B,wBAAkB,UAAU;AAC5B;AAAA,IACF;AAEA,QAAI,WAAW;AACb,kBAAY;AACZ;AAAA,IACF;AAEA,QAAI,CAAC,kBAAkB;AACrB;AAAA,IACF;AAEA,UAAM,OAAO,SAAS,WAAW,CAAC,GAAG,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC;AAAA,EACnE,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,CAAC;AAAA,IACZ,WAAW,CAAC;AAAA,IACZ,WAAW,CAAC;AAAA,EACd,CAAC;AAED,SAAO,oBAAC,SAAK,GAAG,gBAAgB,KAAK,cAAc;AACrD,CAAC;;;AE3HD,IAAM,iBAAiB,oBAAI,QAA8B;AAElD,SAAS,wBAAwB,YAA+B;AACrE,QAAM,QAAQ;AAEd,QAAM,aAAa;AACnB,QAAM,cAAc;AACtB;AAEO,SAAS,sBACd,eACG,SACH;AACA,0BAAwB,UAAU;AAElC,QAAM,WAAW,eAAe,IAAI,UAAU,KAAK,oBAAI,IAAa;AAEpE,aAAW,SAAS,SAAS;AAC3B,UAAM,UAAW,MAAgE,WAAW;AAE5F,QAAI,SAAS,IAAI,OAAO,GAAG;AACzB;AAAA,IACF;AAEA,QAAI,OAAO,YAAY,YAAY;AACjC,cAAQ,UAAU;AAClB,eAAS,IAAI,OAAO;AAAA,IACtB;AAAA,EACF;AAEA,iBAAe,IAAI,YAAY,QAAQ;AACzC;","names":["Chart"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@revivejs/react-highcharts",
|
|
3
|
+
"version": "17.0.0",
|
|
4
|
+
"description": "A thin React 17 wrapper for Highcharts with versioned demos.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"react-library",
|
|
8
|
+
"typescript",
|
|
9
|
+
"highcharts",
|
|
10
|
+
"charts",
|
|
11
|
+
"react-highcharts",
|
|
12
|
+
"highcharts-react",
|
|
13
|
+
"stock-chart",
|
|
14
|
+
"heatmap",
|
|
15
|
+
"3d-chart",
|
|
16
|
+
"wrapper",
|
|
17
|
+
"ui-component",
|
|
18
|
+
"revived",
|
|
19
|
+
"maintained"
|
|
20
|
+
],
|
|
21
|
+
"homepage": "https://alexandroit.github.io/react-highcharts/",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/alexandroit/react-highcharts/issues"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/alexandroit/react-highcharts.git"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"type": "module",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"main": "./dist/index.cjs",
|
|
37
|
+
"module": "./dist/index.js",
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"import": "./dist/index.js",
|
|
43
|
+
"require": "./dist/index.cjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"sideEffects": false,
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsup",
|
|
49
|
+
"clean": "rm -rf dist docs/react-17",
|
|
50
|
+
"docs:install:react-17": "cd docs-src/react-17 && npm install",
|
|
51
|
+
"build:docs:react-17": "cd docs-src/react-17 && npm run build",
|
|
52
|
+
"build:docs": "npm run build:docs:react-17",
|
|
53
|
+
"typecheck": "tsc --noEmit"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"highcharts": ">=12.5.0",
|
|
57
|
+
"react": ">=17.0.0 <18.0.0",
|
|
58
|
+
"react-dom": ">=17.0.0 <18.0.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@types/react": "17.0.91",
|
|
62
|
+
"@types/react-dom": "17.0.26",
|
|
63
|
+
"highcharts": "12.5.0",
|
|
64
|
+
"react": "17.0.2",
|
|
65
|
+
"react-dom": "17.0.2",
|
|
66
|
+
"tsup": "8.5.1",
|
|
67
|
+
"typescript": "5.9.3"
|
|
68
|
+
}
|
|
69
|
+
}
|