@unovis/react 1.7.0-pre.1 → 1.7.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/README.md +4 -0
- package/components/annotations/index.d.ts +12 -10
- package/components/annotations/index.js +32 -27
- package/components/annotations/index.js.map +1 -1
- package/components/area/index.d.ts +13 -11
- package/components/area/index.js +33 -29
- package/components/area/index.js.map +1 -1
- package/components/axis/index.d.ts +13 -11
- package/components/axis/index.js +33 -29
- package/components/axis/index.js.map +1 -1
- package/components/boxplot/index.d.ts +13 -0
- package/components/boxplot/index.js +35 -0
- package/components/boxplot/index.js.map +1 -0
- package/components/brush/index.d.ts +13 -11
- package/components/brush/index.js +33 -29
- package/components/brush/index.js.map +1 -1
- package/components/chord-diagram/index.d.ts +17 -14
- package/components/chord-diagram/index.js +33 -29
- package/components/chord-diagram/index.js.map +1 -1
- package/components/crosshair/index.d.ts +13 -11
- package/components/crosshair/index.js +33 -29
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/index.d.ts +13 -11
- package/components/donut/index.js +33 -29
- package/components/donut/index.js.map +1 -1
- package/components/free-brush/index.d.ts +13 -11
- package/components/free-brush/index.js +33 -29
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/index.d.ts +39 -36
- package/components/graph/index.js +33 -29
- package/components/graph/index.js.map +1 -1
- package/components/grouped-bar/index.d.ts +13 -11
- package/components/grouped-bar/index.js +33 -29
- package/components/grouped-bar/index.js.map +1 -1
- package/components/heatmap/index.d.ts +13 -0
- package/components/heatmap/index.js +35 -0
- package/components/heatmap/index.js.map +1 -0
- package/components/line/index.d.ts +13 -11
- package/components/line/index.js +33 -29
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/index.d.ts +13 -11
- package/components/nested-donut/index.js +33 -29
- package/components/nested-donut/index.js.map +1 -1
- package/components/plotband/index.d.ts +12 -10
- package/components/plotband/index.js +32 -27
- package/components/plotband/index.js.map +1 -1
- package/components/plotline/index.d.ts +12 -10
- package/components/plotline/index.js +32 -27
- package/components/plotline/index.js.map +1 -1
- package/components/radial-bar/index.d.ts +13 -0
- package/components/radial-bar/index.js +35 -0
- package/components/radial-bar/index.js.map +1 -0
- package/components/sankey/index.d.ts +17 -14
- package/components/sankey/index.js +33 -29
- package/components/sankey/index.js.map +1 -1
- package/components/scatter/index.d.ts +13 -11
- package/components/scatter/index.js +33 -29
- package/components/scatter/index.js.map +1 -1
- package/components/stacked-bar/index.d.ts +13 -11
- package/components/stacked-bar/index.js +33 -29
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/index.d.ts +13 -11
- package/components/timeline/index.js +33 -29
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/index.d.ts +12 -10
- package/components/tooltip/index.js +32 -27
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/index.d.ts +17 -15
- package/components/topojson-map/index.js +33 -29
- package/components/topojson-map/index.js.map +1 -1
- package/components/treemap/index.d.ts +13 -11
- package/components/treemap/index.js +33 -29
- package/components/treemap/index.js.map +1 -1
- package/components/xy-labels/index.d.ts +13 -11
- package/components/xy-labels/index.js +33 -29
- package/components/xy-labels/index.js.map +1 -1
- package/components.d.ts +30 -27
- package/composites/time-series/index.d.ts +55 -54
- package/composites/time-series/index.js +65 -60
- package/composites/time-series/index.js.map +1 -1
- package/composites/time-series/style.module.css.js +14 -7
- package/composites/time-series/style.module.css.js.map +1 -1
- package/composites.d.ts +1 -1
- package/containers/single-container/index.d.ts +9 -8
- package/containers/single-container/index.js +67 -49
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/index.d.ts +10 -9
- package/containers/xy-container/index.js +71 -57
- package/containers/xy-container/index.js.map +1 -1
- package/containers.d.ts +2 -2
- package/html-components/bullet-legend/index.d.ts +13 -11
- package/html-components/bullet-legend/index.js +30 -27
- package/html-components/bullet-legend/index.js.map +1 -1
- package/html-components/flow-legend/index.d.ts +13 -11
- package/html-components/flow-legend/index.js +30 -27
- package/html-components/flow-legend/index.js.map +1 -1
- package/html-components/leaflet-flow-map/index.d.ts +18 -15
- package/html-components/leaflet-flow-map/index.js +31 -29
- package/html-components/leaflet-flow-map/index.js.map +1 -1
- package/html-components/leaflet-map/index.d.ts +15 -12
- package/html-components/leaflet-map/index.js +31 -29
- package/html-components/leaflet-map/index.js.map +1 -1
- package/html-components/rolling-pin-legend/index.d.ts +13 -11
- package/html-components/rolling-pin-legend/index.js +30 -27
- package/html-components/rolling-pin-legend/index.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +111 -30
- package/index.js.map +1 -1
- package/package.json +25 -23
- package/types/dom.d.ts +3 -3
- package/utils/container.d.ts +5 -0
- package/utils/container.js +18 -0
- package/utils/container.js.map +1 -0
- package/utils/react.d.ts +5 -4
- package/utils/react.js +22 -29
- package/utils/react.js.map +1 -1
- package/external/style-inject/dist/style-inject.es.js +0 -29
- package/external/style-inject/dist/style-inject.es.js.map +0 -1
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { RollingPinLegend } from
|
|
3
|
-
import { arePropsEqual } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
1
|
+
import React, { useRef, useEffect, useImperativeHandle } from "react";
|
|
2
|
+
import { RollingPinLegend } from "@unovis/ts/components/rolling-pin-legend";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
const VisRollingPinLegendSelectors = RollingPinLegend.selectors;
|
|
5
|
+
function VisRollingPinLegendFC(props, fRef) {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const componentRef = useRef(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
const c = new RollingPinLegend(ref.current, props);
|
|
11
|
+
componentRef.current = c;
|
|
12
|
+
element.__component__ = c;
|
|
13
|
+
return () => {
|
|
14
|
+
componentRef.current = void 0;
|
|
15
|
+
c.destroy();
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const component = componentRef.current;
|
|
20
|
+
component?.setConfig(props);
|
|
21
|
+
});
|
|
22
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
23
|
+
return componentRef.current;
|
|
24
|
+
} }), []);
|
|
25
|
+
return /* @__PURE__ */ React.createElement("div", { className: props.className, ref });
|
|
26
|
+
}
|
|
26
27
|
const VisRollingPinLegend = React.memo(React.forwardRef(VisRollingPinLegendFC), arePropsEqual);
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
export {
|
|
29
|
+
VisRollingPinLegend,
|
|
30
|
+
VisRollingPinLegendSelectors
|
|
31
|
+
};
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/html-components/rolling-pin-legend/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { RollingPinLegend
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/html-components/rolling-pin-legend/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { RollingPinLegend } from '@unovis/ts/components/rolling-pin-legend'\nimport { RollingPinLegendConfigInterface } from '@unovis/ts/components/rolling-pin-legend/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisRollingPinLegendRef = {\n component?: RollingPinLegend;\n}\n\nexport type VisRollingPinLegendProps = RollingPinLegendConfigInterface & {\n ref?: Ref<VisRollingPinLegendRef>;\n className?: string;\n}\n\nexport const VisRollingPinLegendSelectors = RollingPinLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisRollingPinLegendFC (props: VisRollingPinLegendProps, fRef: ForwardedRef<VisRollingPinLegendRef>): ReactElement {\n const ref = useRef<VisComponentElement<RollingPinLegend, HTMLDivElement>>(null)\n const componentRef = useRef<RollingPinLegend | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<RollingPinLegend, HTMLDivElement>)\n\n const c = new RollingPinLegend(ref.current as VisComponentElement<RollingPinLegend, HTMLDivElement>, props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <div className={props.className} ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisRollingPinLegend: ((props: VisRollingPinLegendProps) => JSX.Element | null) = React.memo(React.forwardRef(VisRollingPinLegendFC), arePropsEqual)\n"],"names":[],"mappings":";;;AAoBO,MAAM,+BAA+B,iBAAiB;AAG7D,SAAS,sBAAuB,OAAiC,MAA0D;AACzH,QAAM,MAAM,OAA8D,IAAI;AAC9E,QAAM,eAAe,OAAqC,MAAS;AAGnE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,iBAAiB,IAAI,SAAkE,KAAK;AAC1G,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAE/B,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAED,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,OAAA,EAAI,WAAW,MAAM,WAAW,KAAU;AACpD;AAIO,MAAM,sBAAiF,MAAM,KAAK,MAAM,WAAW,qBAAqB,GAAG,aAAa;"}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './containers';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from './composites';
|
|
1
|
+
export * from './containers';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './composites';
|
package/index.js
CHANGED
|
@@ -1,31 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
try {
|
|
4
|
+
if (typeof document != "undefined") {
|
|
5
|
+
var elementStyle = document.createElement("style");
|
|
6
|
+
elementStyle.appendChild(document.createTextNode("._timeSeriesContainer_1ayv5_1 {\n position: relative;\n height: 400px;\n width: 100%;\n font-family: sans-serif;\n}\n\n._timeSeriesModule_1ayv5_8 {\n width: 100%;\n height: 70%;\n position: relative;\n}\n\n._navigationModule_1ayv5_14 {\n width: 100%;\n height: 30%;\n position: relative;\n}"));
|
|
7
|
+
document.head.appendChild(elementStyle);
|
|
8
|
+
}
|
|
9
|
+
} catch (e) {
|
|
10
|
+
console.error("vite-plugin-css-injected-by-js", e);
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
import { VisAnnotations, VisAnnotationsSelectors } from "./components/annotations/index.js";
|
|
14
|
+
import { VisArea, VisAreaSelectors } from "./components/area/index.js";
|
|
15
|
+
import { VisAxis, VisAxisSelectors } from "./components/axis/index.js";
|
|
16
|
+
import { VisBoxplot, VisBoxplotSelectors } from "./components/boxplot/index.js";
|
|
17
|
+
import { VisBrush, VisBrushSelectors } from "./components/brush/index.js";
|
|
18
|
+
import { VisBulletLegend, VisBulletLegendSelectors } from "./html-components/bullet-legend/index.js";
|
|
19
|
+
import { VisChordDiagram, VisChordDiagramSelectors } from "./components/chord-diagram/index.js";
|
|
20
|
+
import { VisCrosshair, VisCrosshairSelectors } from "./components/crosshair/index.js";
|
|
21
|
+
import { VisDonut, VisDonutSelectors } from "./components/donut/index.js";
|
|
22
|
+
import { VisFlowLegend, VisFlowLegendSelectors } from "./html-components/flow-legend/index.js";
|
|
23
|
+
import { VisFreeBrush, VisFreeBrushSelectors } from "./components/free-brush/index.js";
|
|
24
|
+
import { VisGraph, VisGraphSelectors } from "./components/graph/index.js";
|
|
25
|
+
import { VisGroupedBar, VisGroupedBarSelectors } from "./components/grouped-bar/index.js";
|
|
26
|
+
import { VisHeatmap, VisHeatmapSelectors } from "./components/heatmap/index.js";
|
|
27
|
+
import { VisLeafletFlowMap, VisLeafletFlowMapSelectors } from "./html-components/leaflet-flow-map/index.js";
|
|
28
|
+
import { VisLeafletMap, VisLeafletMapSelectors } from "./html-components/leaflet-map/index.js";
|
|
29
|
+
import { VisLine, VisLineSelectors } from "./components/line/index.js";
|
|
30
|
+
import { VisNestedDonut, VisNestedDonutSelectors } from "./components/nested-donut/index.js";
|
|
31
|
+
import { VisPlotband, VisPlotbandSelectors } from "./components/plotband/index.js";
|
|
32
|
+
import { VisPlotline, VisPlotlineSelectors } from "./components/plotline/index.js";
|
|
33
|
+
import { VisRadialBar, VisRadialBarSelectors } from "./components/radial-bar/index.js";
|
|
34
|
+
import { VisRollingPinLegend, VisRollingPinLegendSelectors } from "./html-components/rolling-pin-legend/index.js";
|
|
35
|
+
import { VisSankey, VisSankeySelectors } from "./components/sankey/index.js";
|
|
36
|
+
import { VisScatter, VisScatterSelectors } from "./components/scatter/index.js";
|
|
37
|
+
import { VisSingleContainer } from "./containers/single-container/index.js";
|
|
38
|
+
import { VisStackedBar, VisStackedBarSelectors } from "./components/stacked-bar/index.js";
|
|
39
|
+
import { VisTimeSeries } from "./composites/time-series/index.js";
|
|
40
|
+
import { VisTimeline, VisTimelineSelectors } from "./components/timeline/index.js";
|
|
41
|
+
import { VisTooltip, VisTooltipSelectors } from "./components/tooltip/index.js";
|
|
42
|
+
import { VisTopoJSONMap, VisTopoJSONMapSelectors } from "./components/topojson-map/index.js";
|
|
43
|
+
import { VisTreemap, VisTreemapSelectors } from "./components/treemap/index.js";
|
|
44
|
+
import { VisXYContainer, VisXYContainerFC } from "./containers/xy-container/index.js";
|
|
45
|
+
import { VisXYLabels, VisXYLabelsSelectors } from "./components/xy-labels/index.js";
|
|
46
|
+
export {
|
|
47
|
+
VisAnnotations,
|
|
48
|
+
VisAnnotationsSelectors,
|
|
49
|
+
VisArea,
|
|
50
|
+
VisAreaSelectors,
|
|
51
|
+
VisAxis,
|
|
52
|
+
VisAxisSelectors,
|
|
53
|
+
VisBoxplot,
|
|
54
|
+
VisBoxplotSelectors,
|
|
55
|
+
VisBrush,
|
|
56
|
+
VisBrushSelectors,
|
|
57
|
+
VisBulletLegend,
|
|
58
|
+
VisBulletLegendSelectors,
|
|
59
|
+
VisChordDiagram,
|
|
60
|
+
VisChordDiagramSelectors,
|
|
61
|
+
VisCrosshair,
|
|
62
|
+
VisCrosshairSelectors,
|
|
63
|
+
VisDonut,
|
|
64
|
+
VisDonutSelectors,
|
|
65
|
+
VisFlowLegend,
|
|
66
|
+
VisFlowLegendSelectors,
|
|
67
|
+
VisFreeBrush,
|
|
68
|
+
VisFreeBrushSelectors,
|
|
69
|
+
VisGraph,
|
|
70
|
+
VisGraphSelectors,
|
|
71
|
+
VisGroupedBar,
|
|
72
|
+
VisGroupedBarSelectors,
|
|
73
|
+
VisHeatmap,
|
|
74
|
+
VisHeatmapSelectors,
|
|
75
|
+
VisLeafletFlowMap,
|
|
76
|
+
VisLeafletFlowMapSelectors,
|
|
77
|
+
VisLeafletMap,
|
|
78
|
+
VisLeafletMapSelectors,
|
|
79
|
+
VisLine,
|
|
80
|
+
VisLineSelectors,
|
|
81
|
+
VisNestedDonut,
|
|
82
|
+
VisNestedDonutSelectors,
|
|
83
|
+
VisPlotband,
|
|
84
|
+
VisPlotbandSelectors,
|
|
85
|
+
VisPlotline,
|
|
86
|
+
VisPlotlineSelectors,
|
|
87
|
+
VisRadialBar,
|
|
88
|
+
VisRadialBarSelectors,
|
|
89
|
+
VisRollingPinLegend,
|
|
90
|
+
VisRollingPinLegendSelectors,
|
|
91
|
+
VisSankey,
|
|
92
|
+
VisSankeySelectors,
|
|
93
|
+
VisScatter,
|
|
94
|
+
VisScatterSelectors,
|
|
95
|
+
VisSingleContainer,
|
|
96
|
+
VisStackedBar,
|
|
97
|
+
VisStackedBarSelectors,
|
|
98
|
+
VisTimeSeries,
|
|
99
|
+
VisTimeline,
|
|
100
|
+
VisTimelineSelectors,
|
|
101
|
+
VisTooltip,
|
|
102
|
+
VisTooltipSelectors,
|
|
103
|
+
VisTopoJSONMap,
|
|
104
|
+
VisTopoJSONMapSelectors,
|
|
105
|
+
VisTreemap,
|
|
106
|
+
VisTreemapSelectors,
|
|
107
|
+
VisXYContainer,
|
|
108
|
+
VisXYContainerFC,
|
|
109
|
+
VisXYLabels,
|
|
110
|
+
VisXYLabelsSelectors
|
|
111
|
+
};
|
|
31
112
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unovis/react",
|
|
3
3
|
"description": "Modular data visualization framework for React, Angular, Svelte, Vue, Solid, and vanilla TypeScript or JavaScript",
|
|
4
|
-
"version": "1.7.0
|
|
5
|
-
"packageManager": "
|
|
4
|
+
"version": "1.7.0",
|
|
5
|
+
"packageManager": "pnpm@10.23.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/f5/unovis.git",
|
|
@@ -29,35 +29,37 @@
|
|
|
29
29
|
"main": "./index.js",
|
|
30
30
|
"types": "./index.d.ts",
|
|
31
31
|
"type": "module",
|
|
32
|
-
"sideEffects":
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"composites/time-series/style.module.css.js",
|
|
34
|
+
"dist/composites/time-series/style.module.css.js"
|
|
35
|
+
],
|
|
33
36
|
"scripts": {
|
|
34
|
-
"build": "
|
|
37
|
+
"build": "vite build; rm -rf dist/.cache; cp LICENSE README.md package.json ./dist",
|
|
35
38
|
"tsc": "tsc",
|
|
36
|
-
"generate": "
|
|
37
|
-
"publish:dist": "cd ./dist; npm publish"
|
|
39
|
+
"generate": "tsx ./autogen/index.ts",
|
|
40
|
+
"publish:dist": "cd ./dist; npm publish",
|
|
41
|
+
"license:check": "pnpm license-report --config=../../lic-report-config.json > licences.md"
|
|
38
42
|
},
|
|
39
43
|
"peerDependencies": {
|
|
40
|
-
"@unovis/ts": "1.7.0
|
|
44
|
+
"@unovis/ts": "1.7.0",
|
|
41
45
|
"react": ">=16.8.0 || ^17 || ^18 || ^19",
|
|
42
46
|
"react-dom": ">=16.8.0 || ^17 || ^18 || ^19"
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
49
|
+
"@unovis/ts": "workspace:*",
|
|
50
|
+
"@unovis/shared": "workspace:*",
|
|
51
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
52
|
+
"@types/react": "^17.0.22",
|
|
47
53
|
"@types/node": "^16.11.17",
|
|
48
|
-
"@
|
|
49
|
-
"
|
|
50
|
-
"react
|
|
54
|
+
"@types/d3-dispatch": "3.0.6",
|
|
55
|
+
"buffer-from": "^1.1.2",
|
|
56
|
+
"react": "^18.3.1",
|
|
57
|
+
"react-dom": "^18.3.1",
|
|
51
58
|
"rimraf": "^3.0.2",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"tslib": "^2.3.1",
|
|
59
|
-
"ttypescript": "^1.5.13",
|
|
60
|
-
"typescript": "~4.2.4"
|
|
61
|
-
},
|
|
62
|
-
"dependencies": {}
|
|
59
|
+
"typescript": "catalog:",
|
|
60
|
+
"tsx": "^4.19.1",
|
|
61
|
+
"vite": "catalog:",
|
|
62
|
+
"vite-plugin-css-injected-by-js": "^3.3.0",
|
|
63
|
+
"vite-plugin-dts": "^3.5.3"
|
|
64
|
+
}
|
|
63
65
|
}
|
package/types/dom.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
__component__: T;
|
|
3
|
-
};
|
|
1
|
+
export type VisComponentElement<T, E = HTMLElement> = E & {
|
|
2
|
+
__component__: T;
|
|
3
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createContext, useContext, useRef, useEffect } from "react";
|
|
2
|
+
const VisContainerContext = createContext(void 0);
|
|
3
|
+
function useContainerRenderOnUpdate() {
|
|
4
|
+
const requestRender = useContext(VisContainerContext)?.requestRender;
|
|
5
|
+
const isInitialRunRef = useRef(true);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (isInitialRunRef.current) {
|
|
8
|
+
isInitialRunRef.current = false;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
requestRender?.();
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
VisContainerContext,
|
|
16
|
+
useContainerRenderOnUpdate
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sources":["../../src/utils/container.ts"],"sourcesContent":["import { createContext, useContext, useEffect, useRef } from 'react'\n\nexport type VisContainerContextValue = {\n /** Asks the owning container to schedule a re-render. */\n requestRender: () => void;\n}\n\n/** Lets a component wrapper ask its container to re-render.\n *\n * A component's `setConfig()` only stores the new config, it doesn't paint — containers own the\n * render loop because they're the ones that recalculate sizes, margins, scales and shared domains\n * in `_preRender()`. The container's own props-update effect can't be relied on to notice a\n * component-level change: `VisSingleContainer` / `VisXYContainer` re-render only when *their*\n * props change, which doesn't happen when a new accessor reaches the component through React\n * context, a parent's state, or any other path that skips the container's props. Without this\n * channel such an update sets the config and never repaints. */\nexport const VisContainerContext = createContext<VisContainerContextValue | undefined>(undefined)\n\n/** Asks the owning container to re-render whenever this component's props change.\n *\n * No equality check is needed here: component wrappers are memoized with `arePropsEqual` and hold\n * no state or changing context, so after the initial mount they re-render — and re-run this\n * effect — only when their props have actually changed. The mount run is skipped because\n * containers render on mount anyway. No-op for components rendered outside of a Unovis\n * container. */\nexport function useContainerRenderOnUpdate (): void {\n const requestRender = useContext(VisContainerContext)?.requestRender\n const isInitialRunRef = useRef(true)\n\n useEffect(() => {\n if (isInitialRunRef.current) {\n isInitialRunRef.current = false\n return\n }\n requestRender?.()\n })\n}\n"],"names":[],"mappings":";AAgBO,MAAM,sBAAsB,cAAoD,MAAS;AASzF,SAAS,6BAAoC;AAClD,QAAM,gBAAgB,WAAW,mBAAmB,GAAG;AACvD,QAAM,kBAAkB,OAAO,IAAI;AAEnC,YAAU,MAAM;AACd,QAAI,gBAAgB,SAAS;AAC3B,sBAAgB,UAAU;AAC1B;AAAA,IACF;AACA,oBAAA;AAAA,EACF,CAAC;AACH;"}
|
package/utils/react.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare function arePropsEqual<PropTypes extends {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}>(prevProps: PropTypes, nextProps: PropTypes): boolean;
|
package/utils/react.js
CHANGED
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
import { Children } from
|
|
2
|
-
import { isEqual } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)]));
|
|
21
|
-
for (const key of propKeys) {
|
|
22
|
-
if (key === 'children')
|
|
23
|
-
continue;
|
|
24
|
-
if (!(isEqual(prevProps[key], nextProps[key])))
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
1
|
+
import { Children } from "react";
|
|
2
|
+
import { isEqual } from "@unovis/ts/utils/data";
|
|
3
|
+
function arePropsEqual(prevProps, nextProps) {
|
|
4
|
+
if (typeof prevProps.children !== typeof nextProps.children) return false;
|
|
5
|
+
if (prevProps.children && nextProps.children) {
|
|
6
|
+
const prevChildren = Children.toArray(prevProps.children);
|
|
7
|
+
const nextChildren = Children.toArray(nextProps.children);
|
|
8
|
+
if (prevChildren.length !== nextChildren.length) return false;
|
|
9
|
+
for (let i = 0; i < nextChildren.length; i += 1) {
|
|
10
|
+
if (!isEqual(prevChildren[i]?.props, nextChildren[i]?.props)) return false;
|
|
11
|
+
if (!isEqual(prevChildren[i].props, nextChildren[i].props)) return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const propKeys = Array.from(/* @__PURE__ */ new Set([...Object.keys(prevProps), ...Object.keys(nextProps)]));
|
|
15
|
+
for (const key of propKeys) {
|
|
16
|
+
if (key === "children") continue;
|
|
17
|
+
if (!isEqual(prevProps[key], nextProps[key])) return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
export {
|
|
22
|
+
arePropsEqual
|
|
23
|
+
};
|
|
31
24
|
//# sourceMappingURL=react.js.map
|
package/utils/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { Children, ReactElement, ReactNode } from 'react'\nimport { isEqual } from '@unovis/ts'\n\nexport function arePropsEqual<PropTypes extends { children?: ReactNode }> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n if (typeof prevProps.children !== typeof nextProps.children) return false\n\n if (prevProps.children && nextProps.children) {\n const prevChildren = Children.toArray(prevProps.children) as ReactElement[]\n const nextChildren = Children.toArray(nextProps.children) as ReactElement[]\n if (prevChildren.length !== nextChildren.length) return false\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n if (!isEqual(prevChildren[i]?.props, nextChildren[i]?.props)) return false\n if (!isEqual(prevChildren[i].props, nextChildren[i].props)) return false\n }\n }\n\n const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])) as (keyof PropTypes)[]\n for (const key of propKeys) {\n if (key === 'children') continue\n if (!(isEqual(prevProps[key], nextProps[key]))) return false\n }\n\n return true\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { Children, ReactElement, ReactNode } from 'react'\nimport { isEqual } from '@unovis/ts/utils/data'\n\nexport function arePropsEqual<PropTypes extends { children?: ReactNode }> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n if (typeof prevProps.children !== typeof nextProps.children) return false\n\n if (prevProps.children && nextProps.children) {\n const prevChildren = Children.toArray(prevProps.children) as ReactElement[]\n const nextChildren = Children.toArray(nextProps.children) as ReactElement[]\n if (prevChildren.length !== nextChildren.length) return false\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n if (!isEqual(prevChildren[i]?.props, nextChildren[i]?.props)) return false\n if (!isEqual(prevChildren[i].props, nextChildren[i].props)) return false\n }\n }\n\n const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])) as (keyof PropTypes)[]\n for (const key of propKeys) {\n if (key === 'children') continue\n if (!(isEqual(prevProps[key], nextProps[key]))) return false\n }\n\n return true\n}\n"],"names":[],"mappings":";;AAGO,SAAS,cAA2D,WAAsB,WAA+B;AAC9H,MAAI,OAAO,UAAU,aAAa,OAAO,UAAU,SAAU,QAAO;AAEpE,MAAI,UAAU,YAAY,UAAU,UAAU;AAC5C,UAAM,eAAe,SAAS,QAAQ,UAAU,QAAQ;AACxD,UAAM,eAAe,SAAS,QAAQ,UAAU,QAAQ;AACxD,QAAI,aAAa,WAAW,aAAa,OAAQ,QAAO;AAExD,aAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK,GAAG;AAC/C,UAAI,CAAC,QAAQ,aAAa,CAAC,GAAG,OAAO,aAAa,CAAC,GAAG,KAAK,EAAG,QAAO;AACrE,UAAI,CAAC,QAAQ,aAAa,CAAC,EAAE,OAAO,aAAa,CAAC,EAAE,KAAK,EAAG,QAAO;AAAA,IACrE;AAAA,EACF;AAEA,QAAM,WAAW,MAAM,KAAK,oBAAI,IAAI,CAAC,GAAG,OAAO,KAAK,SAAS,GAAG,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;AAC3F,aAAW,OAAO,UAAU;AAC1B,QAAI,QAAQ,WAAY;AACxB,QAAI,CAAE,QAAQ,UAAU,GAAG,GAAG,UAAU,GAAG,CAAC,EAAI,QAAO;AAAA,EACzD;AAEA,SAAO;AACT;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
function styleInject(css, ref) {
|
|
2
|
-
if ( ref === void 0 ) ref = {};
|
|
3
|
-
var insertAt = ref.insertAt;
|
|
4
|
-
|
|
5
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
6
|
-
|
|
7
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
8
|
-
var style = document.createElement('style');
|
|
9
|
-
style.type = 'text/css';
|
|
10
|
-
|
|
11
|
-
if (insertAt === 'top') {
|
|
12
|
-
if (head.firstChild) {
|
|
13
|
-
head.insertBefore(style, head.firstChild);
|
|
14
|
-
} else {
|
|
15
|
-
head.appendChild(style);
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
head.appendChild(style);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (style.styleSheet) {
|
|
22
|
-
style.styleSheet.cssText = css;
|
|
23
|
-
} else {
|
|
24
|
-
style.appendChild(document.createTextNode(css));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { styleInject as default };
|
|
29
|
-
//# sourceMappingURL=style-inject.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-inject.es.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;"}
|