@radishcandy/h-charts 0.1.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/dist/react.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),_=require("./HChart-DKVtg5A8.cjs");function N(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const u in o)if(u!=="default"){const i=Object.getOwnPropertyDescriptor(o,u);Object.defineProperty(t,u,i.get?i:{enumerable:!0,get:()=>o[u]})}}return t.default=o,Object.freeze(t)}const n=N(D),p=n.forwardRef(function(t,u){const{options:i,plugins:O=[],markerConfig:v,updateOnOptionsChange:h=!1}=t,y=n.useRef(null),r=n.useRef(null),R=n.useRef(()=>{}),k=n.useRef({options:i,plugins:O,markerConfig:v}),d=n.useRef({});return d.current={onReady:t.onReady,onCursorChange:t.onCursorChange,onChartClick:t.onChartClick,onDestroyed:t.onDestroyed},n.useImperativeHandle(u,()=>({getInstance:()=>r.current,getNativeChart:()=>{var e;return((e=r.current)==null?void 0:e.chart)||null},setCursorX:e=>{var a;return(a=r.current)==null?void 0:a.setCursorX(e)},setData:(e,a=0,s=!0)=>{var l;return(l=r.current)==null?void 0:l.setSeriesData(e,a,s)},updateOptions:(e,a=!0)=>{var s;return(s=r.current)==null?void 0:s.updateOptions(e,a)},requestReflow:()=>{var e;return(e=r.current)==null?void 0:e.requestReflow()},destroy:()=>R.current()}),[]),n.useEffect(()=>{var w,b;const e=y.current;if(!e||r.current)return;let a=!1;const s={name:"__HChartViewReactEventBridge__",init(){},destroy(){},enable(){},disable(){},update(){},onCursorChange:f=>{var c,C;return(C=(c=d.current).onCursorChange)==null?void 0:C.call(c,f)},onChartClick:f=>{var c,C;return(C=(c=d.current).onChartClick)==null?void 0:C.call(c,f)}},l=k.current,H={container:e,options:l.options,plugins:[...l.plugins,s],markerConfig:l.markerConfig},g=new _.HChart(H);r.current=g,(b=(w=d.current).onReady)==null||b.call(w,g);function m(){var f,c;a||(a=!0,r.current===g&&(r.current=null),g.destroy(),(c=(f=d.current).onDestroyed)==null||c.call(f))}return R.current=m,m},[]),n.useEffect(()=>{var e;h&&((e=r.current)==null||e.updateOptions(i))},[i,h]),n.createElement("div",{ref:y,className:t.className?`hchart-view ${t.className}`:"hchart-view",style:{minHeight:160,width:"100%",height:"100%",...t.style}})});p.displayName="HChartView";exports.HChartView=p;
@@ -0,0 +1,166 @@
1
+ import * as Highcharts_2 from 'highcharts';
2
+ import * as React_2 from 'react';
3
+
4
+ /**
5
+ * HChart - Highcharts Wrapper Class
6
+ *
7
+ * Encapsulates Highcharts initialization, default configuration, and plugin management.
8
+ */
9
+ declare class HChart implements IHChart {
10
+ chart: Highcharts_2.Chart;
11
+ plugins: Map<string, IPlugin>;
12
+ container: HTMLElement;
13
+ activePoint: Point | null;
14
+ private resizeObserver;
15
+ private reflowFrame;
16
+ constructor(config: HChartConfig);
17
+ addPlugin(plugin: IPlugin): void;
18
+ getPlugin<T extends IPlugin>(name: string): T | undefined;
19
+ removePlugin(name: string): void;
20
+ /**
21
+ * Coalesce multiple size changes into one chart reflow in the next animation frame.
22
+ * ResizeObserver can fire repeatedly while split panes and cards are animating.
23
+ */
24
+ requestReflow(): void;
25
+ destroy(): void;
26
+ private onChartClick;
27
+ setCursor(point: Point): void;
28
+ /**
29
+ * Set cursor by X value (will snap to nearest point)
30
+ */
31
+ setCursorX(x: number): void;
32
+ /**
33
+ * Toggle a plugin by name
34
+ */
35
+ togglePlugin(name: string, enabled: boolean): void;
36
+ /** Update the underlying Highcharts options without recreating plugins. */
37
+ updateOptions(options: Highcharts_2.Options, redraw?: boolean): void;
38
+ /** Replace one series data set through the stable HChart API. */
39
+ setSeriesData(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
40
+ getSeriesData(): number[][];
41
+ private resolveMarkerConfig;
42
+ /**
43
+ * Adds a static reference line (vertical or horizontal) to the chart.
44
+ * Useful for thresholds, limits, or markers.
45
+ *
46
+ * @param options Configuration for the reference line
47
+ * @returns The unique ID of the added line (use to remove later)
48
+ */
49
+ addReferenceLine(options: {
50
+ axis?: 'x' | 'y';
51
+ value: number;
52
+ color?: string;
53
+ text?: string;
54
+ width?: number;
55
+ dashStyle?: Highcharts_2.DashStyleValue;
56
+ zIndex?: number;
57
+ }): string;
58
+ removeReferenceLine(id: string, axis?: 'x' | 'y'): void;
59
+ }
60
+
61
+ declare interface HChartConfig {
62
+ /**
63
+ * The ID of the container element or the element itself.
64
+ */
65
+ container: string | HTMLElement;
66
+ /**
67
+ * Standard Highcharts options to override defaults.
68
+ */
69
+ options?: Highcharts_2.Options;
70
+ /**
71
+ * List of plugins to initialize with the chart.
72
+ */
73
+ plugins?: IPlugin[];
74
+ /**
75
+ * Configuration for data point markers.
76
+ */
77
+ markerConfig?: {
78
+ /**
79
+ * Force enable/disable markers.
80
+ */
81
+ enabled?: boolean;
82
+ /**
83
+ * If true, markers are enabled based on data density (threshold).
84
+ */
85
+ auto?: boolean;
86
+ /**
87
+ * Maximum number of points to show markers in auto mode (default 50).
88
+ */
89
+ threshold?: number;
90
+ };
91
+ theme?: 'light' | 'dark';
92
+ }
93
+
94
+ declare type HChartMarkerConfig = NonNullable<HChartConfig['markerConfig']>;
95
+
96
+ /** Methods exposed by the React host adapter. */
97
+ export declare interface HChartReactHandle {
98
+ /** Return the framework-agnostic HChart instance, if it is mounted. */
99
+ getInstance(): HChart | null;
100
+ /** Return the underlying Highcharts object, if it is mounted. */
101
+ getNativeChart(): Highcharts_2.Chart | null;
102
+ setCursorX(x: number): void;
103
+ setData(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
104
+ updateOptions(options: Highcharts_2.Options, redraw?: boolean): void;
105
+ requestReflow(): void;
106
+ destroy(): void;
107
+ }
108
+
109
+ /**
110
+ * A thin React 18/19 adapter around the framework-agnostic HChart class.
111
+ *
112
+ * The adapter owns only the DOM ref and React lifecycle. Chart updates remain
113
+ * imperative so plugin instances are not recreated on every render.
114
+ */
115
+ export declare const HChartView: React_2.ForwardRefExoticComponent<HChartViewProps & React_2.RefAttributes<HChartReactHandle>>;
116
+
117
+ export declare interface HChartViewProps {
118
+ options: Highcharts_2.Options;
119
+ plugins?: IPlugin[];
120
+ markerConfig?: HChartMarkerConfig;
121
+ /** Update the existing chart when the options object changes identity. */
122
+ updateOnOptionsChange?: boolean;
123
+ className?: string;
124
+ style?: React_2.CSSProperties;
125
+ onReady?: (instance: HChart) => void;
126
+ onCursorChange?: (point: Point) => void;
127
+ onChartClick?: (event: Highcharts_2.PointerEventObject) => void;
128
+ onDestroyed?: () => void;
129
+ }
130
+
131
+ declare interface IHChart {
132
+ chart: Highcharts_2.Chart;
133
+ container: HTMLElement;
134
+ activePoint: Point | null;
135
+ addPlugin(plugin: IPlugin): void;
136
+ getPlugin<T extends IPlugin>(name: string): T | undefined;
137
+ removePlugin(name: string): void;
138
+ requestReflow(): void;
139
+ destroy(): void;
140
+ setCursor(point: Point): void;
141
+ setCursorX(x: number): void;
142
+ togglePlugin(name: string, enabled: boolean): void;
143
+ updateOptions?(options: Highcharts_2.Options, redraw?: boolean): void;
144
+ setSeriesData?(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
145
+ }
146
+
147
+ declare interface IPlugin {
148
+ name: string;
149
+ init(chart: IHChart): void;
150
+ destroy(): void;
151
+ enable(): void;
152
+ disable(): void;
153
+ update(options: any): void;
154
+ isEnabled?(): boolean;
155
+ onChartClick?(e: Highcharts_2.PointerEventObject): void;
156
+ onCursorChange?(point: Point): void;
157
+ }
158
+
159
+ declare interface Point {
160
+ x: number;
161
+ y: number;
162
+ index: number;
163
+ seriesIndex?: number;
164
+ }
165
+
166
+ export { }
package/dist/react.js ADDED
@@ -0,0 +1,87 @@
1
+ import * as r from "react";
2
+ import { H as D } from "./HChart-B61851DE.js";
3
+ const N = r.forwardRef(function(a, w) {
4
+ const { options: C, plugins: k = [], markerConfig: v, updateOnOptionsChange: d = !1 } = a, h = r.useRef(null), t = r.useRef(null), g = r.useRef(() => {
5
+ }), H = r.useRef({ options: C, plugins: k, markerConfig: v }), u = r.useRef({});
6
+ return u.current = {
7
+ onReady: a.onReady,
8
+ onCursorChange: a.onCursorChange,
9
+ onChartClick: a.onChartClick,
10
+ onDestroyed: a.onDestroyed
11
+ }, r.useImperativeHandle(
12
+ w,
13
+ () => ({
14
+ getInstance: () => t.current,
15
+ getNativeChart: () => {
16
+ var e;
17
+ return ((e = t.current) == null ? void 0 : e.chart) || null;
18
+ },
19
+ setCursorX: (e) => {
20
+ var n;
21
+ return (n = t.current) == null ? void 0 : n.setCursorX(e);
22
+ },
23
+ setData: (e, n = 0, s = !0) => {
24
+ var c;
25
+ return (c = t.current) == null ? void 0 : c.setSeriesData(e, n, s);
26
+ },
27
+ updateOptions: (e, n = !0) => {
28
+ var s;
29
+ return (s = t.current) == null ? void 0 : s.updateOptions(e, n);
30
+ },
31
+ requestReflow: () => {
32
+ var e;
33
+ return (e = t.current) == null ? void 0 : e.requestReflow();
34
+ },
35
+ destroy: () => g.current()
36
+ }),
37
+ []
38
+ ), r.useEffect(() => {
39
+ var m, y;
40
+ const e = h.current;
41
+ if (!e || t.current) return;
42
+ let n = !1;
43
+ const s = {
44
+ name: "__HChartViewReactEventBridge__",
45
+ init() {
46
+ },
47
+ destroy() {
48
+ },
49
+ enable() {
50
+ },
51
+ disable() {
52
+ },
53
+ update() {
54
+ },
55
+ onCursorChange: (i) => {
56
+ var o, f;
57
+ return (f = (o = u.current).onCursorChange) == null ? void 0 : f.call(o, i);
58
+ },
59
+ onChartClick: (i) => {
60
+ var o, f;
61
+ return (f = (o = u.current).onChartClick) == null ? void 0 : f.call(o, i);
62
+ }
63
+ }, c = H.current, p = {
64
+ container: e,
65
+ options: c.options,
66
+ plugins: [...c.plugins, s],
67
+ markerConfig: c.markerConfig
68
+ }, l = new D(p);
69
+ t.current = l, (y = (m = u.current).onReady) == null || y.call(m, l);
70
+ function R() {
71
+ var i, o;
72
+ n || (n = !0, t.current === l && (t.current = null), l.destroy(), (o = (i = u.current).onDestroyed) == null || o.call(i));
73
+ }
74
+ return g.current = R, R;
75
+ }, []), r.useEffect(() => {
76
+ var e;
77
+ d && ((e = t.current) == null || e.updateOptions(C));
78
+ }, [C, d]), r.createElement("div", {
79
+ ref: h,
80
+ className: a.className ? `hchart-view ${a.className}` : "hchart-view",
81
+ style: { minHeight: 160, width: "100%", height: "100%", ...a.style }
82
+ });
83
+ });
84
+ N.displayName = "HChartView";
85
+ export {
86
+ N as HChartView
87
+ };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .hchart-view{width:100%;height:100%;min-height:160px}
package/dist/vue.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),w=require("./HChart-DKVtg5A8.cjs"),k=r.defineComponent({name:"HChartView",__name:"HChartView",props:{options:{},plugins:{default:()=>[]},markerConfig:{},updateOnOptionsChange:{type:Boolean,default:!1}},emits:["ready","cursor-change","chart-click","destroyed"],setup(l,{expose:f,emit:p}){const a=l,o=p,i=r.ref(null),n=r.shallowRef(null);function d(){return{name:"__HChartViewEventBridge__",init(){},destroy(){},enable(){},disable(){},update(){},onCursorChange(e){o("cursor-change",e)},onChartClick(e){o("chart-click",e)}}}function h(){if(!i.value||n.value)return n.value;const e={container:i.value,options:a.options,plugins:[...a.plugins,d()],markerConfig:a.markerConfig},t=new w.HChart(e);return n.value=t,o("ready",t),t}function s(){n.value&&(n.value.destroy(),n.value=null,o("destroyed"))}function v(){return n.value}function C(){var e;return((e=n.value)==null?void 0:e.chart)||null}function g(e){var t;(t=n.value)==null||t.setCursorX(e)}function m(e,t=0,u=!0){var c;(c=n.value)==null||c.setSeriesData(e,t,u)}function y(e,t=!0){var u;(u=n.value)==null||u.updateOptions(e,t)}function _(){var e;(e=n.value)==null||e.requestReflow()}return r.watch(()=>a.options,e=>{var t;a.updateOnOptionsChange&&((t=n.value)==null||t.updateOptions(e))},{deep:!0}),r.onMounted(h),r.onBeforeUnmount(s),f({getInstance:v,getNativeChart:C,setCursorX:g,setData:m,updateOptions:y,requestReflow:_,destroy:s}),(e,t)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:i,class:"hchart-view"},null,512))}});exports.HChartView=k;
package/dist/vue.d.ts ADDED
@@ -0,0 +1,180 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { DefineComponent } from 'vue';
4
+ import * as Highcharts_2 from 'highcharts';
5
+ import { PublicProps } from 'vue';
6
+
7
+ declare type __VLS_Props = {
8
+ options: Highcharts_2.Options;
9
+ plugins?: IPlugin[];
10
+ markerConfig?: HChartMarkerConfig;
11
+ updateOnOptionsChange?: boolean;
12
+ };
13
+
14
+ declare function destroy(): void;
15
+
16
+ declare function getInstance(): HChart | null;
17
+
18
+ declare function getNativeChart(): Highcharts_2.Chart | null;
19
+
20
+ /**
21
+ * HChart - Highcharts Wrapper Class
22
+ *
23
+ * Encapsulates Highcharts initialization, default configuration, and plugin management.
24
+ */
25
+ export declare class HChart implements IHChart {
26
+ chart: Highcharts_2.Chart;
27
+ plugins: Map<string, IPlugin>;
28
+ container: HTMLElement;
29
+ activePoint: Point | null;
30
+ private resizeObserver;
31
+ private reflowFrame;
32
+ constructor(config: HChartConfig);
33
+ addPlugin(plugin: IPlugin): void;
34
+ getPlugin<T extends IPlugin>(name: string): T | undefined;
35
+ removePlugin(name: string): void;
36
+ /**
37
+ * Coalesce multiple size changes into one chart reflow in the next animation frame.
38
+ * ResizeObserver can fire repeatedly while split panes and cards are animating.
39
+ */
40
+ requestReflow(): void;
41
+ destroy(): void;
42
+ private onChartClick;
43
+ setCursor(point: Point): void;
44
+ /**
45
+ * Set cursor by X value (will snap to nearest point)
46
+ */
47
+ setCursorX(x: number): void;
48
+ /**
49
+ * Toggle a plugin by name
50
+ */
51
+ togglePlugin(name: string, enabled: boolean): void;
52
+ /** Update the underlying Highcharts options without recreating plugins. */
53
+ updateOptions(options: Highcharts_2.Options, redraw?: boolean): void;
54
+ /** Replace one series data set through the stable HChart API. */
55
+ setSeriesData(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
56
+ getSeriesData(): number[][];
57
+ private resolveMarkerConfig;
58
+ /**
59
+ * Adds a static reference line (vertical or horizontal) to the chart.
60
+ * Useful for thresholds, limits, or markers.
61
+ *
62
+ * @param options Configuration for the reference line
63
+ * @returns The unique ID of the added line (use to remove later)
64
+ */
65
+ addReferenceLine(options: {
66
+ axis?: 'x' | 'y';
67
+ value: number;
68
+ color?: string;
69
+ text?: string;
70
+ width?: number;
71
+ dashStyle?: Highcharts_2.DashStyleValue;
72
+ zIndex?: number;
73
+ }): string;
74
+ removeReferenceLine(id: string, axis?: 'x' | 'y'): void;
75
+ }
76
+
77
+ declare interface HChartConfig {
78
+ /**
79
+ * The ID of the container element or the element itself.
80
+ */
81
+ container: string | HTMLElement;
82
+ /**
83
+ * Standard Highcharts options to override defaults.
84
+ */
85
+ options?: Highcharts_2.Options;
86
+ /**
87
+ * List of plugins to initialize with the chart.
88
+ */
89
+ plugins?: IPlugin[];
90
+ /**
91
+ * Configuration for data point markers.
92
+ */
93
+ markerConfig?: {
94
+ /**
95
+ * Force enable/disable markers.
96
+ */
97
+ enabled?: boolean;
98
+ /**
99
+ * If true, markers are enabled based on data density (threshold).
100
+ */
101
+ auto?: boolean;
102
+ /**
103
+ * Maximum number of points to show markers in auto mode (default 50).
104
+ */
105
+ threshold?: number;
106
+ };
107
+ theme?: 'light' | 'dark';
108
+ }
109
+
110
+ declare type HChartMarkerConfig = NonNullable<HChartConfig['markerConfig']>;
111
+
112
+ export declare const HChartView: DefineComponent<__VLS_Props, {
113
+ getInstance: typeof getInstance;
114
+ getNativeChart: typeof getNativeChart;
115
+ setCursorX: typeof setCursorX;
116
+ setData: typeof setData;
117
+ updateOptions: typeof updateOptions;
118
+ requestReflow: typeof requestReflow;
119
+ destroy: typeof destroy;
120
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
121
+ ready: (instance: HChart) => any;
122
+ "cursor-change": (point: Point) => any;
123
+ "chart-click": (event: Highcharts_2.PointerEventObject) => any;
124
+ destroyed: () => any;
125
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
126
+ onReady?: ((instance: HChart) => any) | undefined;
127
+ "onCursor-change"?: ((point: Point) => any) | undefined;
128
+ "onChart-click"?: ((event: Highcharts_2.PointerEventObject) => any) | undefined;
129
+ onDestroyed?: (() => any) | undefined;
130
+ }>, {
131
+ plugins: IPlugin[];
132
+ updateOnOptionsChange: boolean;
133
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
134
+ container: HTMLDivElement;
135
+ }, HTMLDivElement>;
136
+
137
+ declare interface IHChart {
138
+ chart: Highcharts_2.Chart;
139
+ container: HTMLElement;
140
+ activePoint: Point | null;
141
+ addPlugin(plugin: IPlugin): void;
142
+ getPlugin<T extends IPlugin>(name: string): T | undefined;
143
+ removePlugin(name: string): void;
144
+ requestReflow(): void;
145
+ destroy(): void;
146
+ setCursor(point: Point): void;
147
+ setCursorX(x: number): void;
148
+ togglePlugin(name: string, enabled: boolean): void;
149
+ updateOptions?(options: Highcharts_2.Options, redraw?: boolean): void;
150
+ setSeriesData?(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
151
+ }
152
+
153
+ declare interface IPlugin {
154
+ name: string;
155
+ init(chart: IHChart): void;
156
+ destroy(): void;
157
+ enable(): void;
158
+ disable(): void;
159
+ update(options: any): void;
160
+ isEnabled?(): boolean;
161
+ onChartClick?(e: Highcharts_2.PointerEventObject): void;
162
+ onCursorChange?(point: Point): void;
163
+ }
164
+
165
+ declare interface Point {
166
+ x: number;
167
+ y: number;
168
+ index: number;
169
+ seriesIndex?: number;
170
+ }
171
+
172
+ declare function requestReflow(): void;
173
+
174
+ declare function setCursorX(x: number): void;
175
+
176
+ declare function setData(data: Highcharts_2.PointOptionsType[], seriesIndex?: number, redraw?: boolean): void;
177
+
178
+ declare function updateOptions(options: Highcharts_2.Options, redraw?: boolean): void;
179
+
180
+ export { }
package/dist/vue.js ADDED
@@ -0,0 +1,96 @@
1
+ import { defineComponent as w, ref as k, shallowRef as y, watch as O, onMounted as B, onBeforeUnmount as H, openBlock as V, createElementBlock as x } from "vue";
2
+ import { H as E } from "./HChart-B61851DE.js";
3
+ const q = /* @__PURE__ */ w({
4
+ name: "HChartView",
5
+ __name: "HChartView",
6
+ props: {
7
+ options: {},
8
+ plugins: { default: () => [] },
9
+ markerConfig: {},
10
+ updateOnOptionsChange: { type: Boolean, default: !1 }
11
+ },
12
+ emits: ["ready", "cursor-change", "chart-click", "destroyed"],
13
+ setup(c, { expose: l, emit: p }) {
14
+ const r = c, a = p, u = k(null), n = y(null);
15
+ function f() {
16
+ return {
17
+ name: "__HChartViewEventBridge__",
18
+ init() {
19
+ },
20
+ destroy() {
21
+ },
22
+ enable() {
23
+ },
24
+ disable() {
25
+ },
26
+ update() {
27
+ },
28
+ onCursorChange(e) {
29
+ a("cursor-change", e);
30
+ },
31
+ onChartClick(e) {
32
+ a("chart-click", e);
33
+ }
34
+ };
35
+ }
36
+ function d() {
37
+ if (!u.value || n.value) return n.value;
38
+ const e = {
39
+ container: u.value,
40
+ options: r.options,
41
+ plugins: [...r.plugins, f()],
42
+ markerConfig: r.markerConfig
43
+ }, t = new E(e);
44
+ return n.value = t, a("ready", t), t;
45
+ }
46
+ function i() {
47
+ n.value && (n.value.destroy(), n.value = null, a("destroyed"));
48
+ }
49
+ function h() {
50
+ return n.value;
51
+ }
52
+ function v() {
53
+ var e;
54
+ return ((e = n.value) == null ? void 0 : e.chart) || null;
55
+ }
56
+ function C(e) {
57
+ var t;
58
+ (t = n.value) == null || t.setCursorX(e);
59
+ }
60
+ function m(e, t = 0, o = !0) {
61
+ var s;
62
+ (s = n.value) == null || s.setSeriesData(e, t, o);
63
+ }
64
+ function g(e, t = !0) {
65
+ var o;
66
+ (o = n.value) == null || o.updateOptions(e, t);
67
+ }
68
+ function _() {
69
+ var e;
70
+ (e = n.value) == null || e.requestReflow();
71
+ }
72
+ return O(
73
+ () => r.options,
74
+ (e) => {
75
+ var t;
76
+ r.updateOnOptionsChange && ((t = n.value) == null || t.updateOptions(e));
77
+ },
78
+ { deep: !0 }
79
+ ), B(d), H(i), l({
80
+ getInstance: h,
81
+ getNativeChart: v,
82
+ setCursorX: C,
83
+ setData: m,
84
+ updateOptions: g,
85
+ requestReflow: _,
86
+ destroy: i
87
+ }), (e, t) => (V(), x("div", {
88
+ ref_key: "container",
89
+ ref: u,
90
+ class: "hchart-view"
91
+ }, null, 512));
92
+ }
93
+ });
94
+ export {
95
+ q as HChartView
96
+ };
package/package.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ "name": "@radishcandy/h-charts",
3
+ "version": "0.1.0",
4
+ "description": "Framework-agnostic Highcharts plugins with optional Vue 3 and React host adapters for industrial analysis.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Yolanda624",
8
+ "url": "https://gitee.com/yolanda624"
9
+ },
10
+ "keywords": [
11
+ "highcharts",
12
+ "charts",
13
+ "data-visualization",
14
+ "typescript",
15
+ "vue",
16
+ "vue3",
17
+ "react",
18
+ "plugins",
19
+ "spectrum-analysis",
20
+ "industrial-monitoring"
21
+ ],
22
+ "type": "module",
23
+ "sideEffects": [
24
+ "./dist/style.css"
25
+ ],
26
+ "files": [
27
+ "dist",
28
+ "README.md",
29
+ "LICENSE",
30
+ "CHANGELOG.md"
31
+ ],
32
+ "main": "./dist/index.cjs",
33
+ "module": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "import": "./dist/index.js",
39
+ "require": "./dist/index.cjs"
40
+ },
41
+ "./vue": {
42
+ "types": "./dist/vue.d.ts",
43
+ "import": "./dist/vue.js",
44
+ "require": "./dist/vue.cjs"
45
+ },
46
+ "./react": {
47
+ "types": "./dist/react.d.ts",
48
+ "import": "./dist/react.js",
49
+ "require": "./dist/react.cjs"
50
+ },
51
+ "./style.css": "./dist/style.css"
52
+ },
53
+ "peerDependencies": {
54
+ "highcharts": "^12.0.0",
55
+ "react": ">=18.0.0",
56
+ "react-dom": ">=18.0.0",
57
+ "vue": "^3.3.0"
58
+ },
59
+ "peerDependenciesMeta": {
60
+ "react": {
61
+ "optional": true
62
+ },
63
+ "react-dom": {
64
+ "optional": true
65
+ },
66
+ "vue": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "devDependencies": {
71
+ "@types/node": "^22.0.0",
72
+ "@vitejs/plugin-vue": "^5.2.0",
73
+ "@types/react": "^19.0.0",
74
+ "@types/react-dom": "^19.0.0",
75
+ "@vitejs/plugin-react": "^4.3.0",
76
+ "happy-dom": "^20.0.0",
77
+ "highcharts": "^12.5.0",
78
+ "react": "^19.0.0",
79
+ "react-dom": "^19.0.0",
80
+ "typescript": "^5.7.0",
81
+ "vite": "^5.4.0",
82
+ "vite-plugin-dts": "^4.5.0",
83
+ "vitest": "^2.1.0",
84
+ "vue": "^3.5.0",
85
+ "vue-tsc": "^2.2.0"
86
+ },
87
+ "scripts": {
88
+ "dev": "vite --config vite.playground.config.ts",
89
+ "dev:react": "vite --config vite.react.playground.config.ts",
90
+ "build": "vite build",
91
+ "test": "vitest run",
92
+ "test:watch": "vitest",
93
+ "typecheck": "vue-tsc --noEmit",
94
+ "pack:check": "npm pack --dry-run",
95
+ "release:check": "npm run typecheck && npm run test && npm run build && npm run pack:check",
96
+ "prepublishOnly": "npm run release:check"
97
+ },
98
+ "repository": {
99
+ "type": "git",
100
+ "url": "https://gitee.com/yolanda624/h-charts.git"
101
+ },
102
+ "bugs": {
103
+ "url": "https://gitee.com/yolanda624/h-charts/issues"
104
+ },
105
+ "homepage": "https://gitee.com/yolanda624/h-charts",
106
+ "publishConfig": {
107
+ "access": "public",
108
+ "provenance": true
109
+ },
110
+ "engines": {
111
+ "node": ">=18.18.0"
112
+ }
113
+ }