@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,34 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { Tooltip } from
|
|
3
|
-
import { arePropsEqual } from
|
|
4
|
-
|
|
5
|
-
const VisTooltipSelectors = Tooltip.selectors;
|
|
6
|
-
function VisTooltipFC(props, fRef) {
|
|
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 { Tooltip } from "@unovis/ts/components/tooltip";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
import { useContainerRenderOnUpdate } from "../../utils/container.js";
|
|
5
|
+
const VisTooltipSelectors = Tooltip.selectors;
|
|
6
|
+
function VisTooltipFC(props, fRef) {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const componentRef = useRef(void 0);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const element = ref.current;
|
|
11
|
+
const c = new Tooltip(props);
|
|
12
|
+
componentRef.current = c;
|
|
13
|
+
element.__component__ = c;
|
|
14
|
+
return () => {
|
|
15
|
+
componentRef.current = void 0;
|
|
16
|
+
c.destroy();
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const component = componentRef.current;
|
|
21
|
+
component?.setConfig(props);
|
|
22
|
+
});
|
|
23
|
+
useContainerRenderOnUpdate();
|
|
24
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
25
|
+
return componentRef.current;
|
|
26
|
+
} }), []);
|
|
27
|
+
return /* @__PURE__ */ React.createElement("vis-tooltip", { ref });
|
|
28
|
+
}
|
|
26
29
|
const VisTooltip = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual);
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
export {
|
|
31
|
+
VisTooltip,
|
|
32
|
+
VisTooltipSelectors
|
|
33
|
+
};
|
|
29
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/tooltip/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 { Tooltip
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/tooltip/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 { Tooltip } from '@unovis/ts/components/tooltip'\nimport { TooltipConfigInterface } from '@unovis/ts/components/tooltip/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTooltipRef = {\n component?: Tooltip;\n}\n\nexport type VisTooltipProps = TooltipConfigInterface & {\n ref?: Ref<VisTooltipRef>;\n}\n\nexport const VisTooltipSelectors = Tooltip.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTooltipFC (props: VisTooltipProps, fRef: ForwardedRef<VisTooltipRef>): ReactElement {\n const ref = useRef<VisComponentElement<Tooltip>>(null)\n const componentRef = useRef<Tooltip | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n\n const c = new Tooltip(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 // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-tooltip 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 VisTooltip: ((props: VisTooltipProps) => JSX.Element | null) = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,sBAAsB,QAAQ;AAG3C,SAAS,aAAc,OAAwB,MAAiD;AAC9F,QAAM,MAAM,OAAqC,IAAI;AACrD,QAAM,eAAe,OAA4B,MAAS;AAG1D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAQ,KAAK;AAC3B,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;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,iBAAY,IAAA,CAAU;AAChC;AAIO,MAAM,aAA+D,MAAM,KAAK,MAAM,WAAW,YAAY,GAAG,aAAa;"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { TopoJSONMap
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { TopoJSONMap } from '@unovis/ts/components/topojson-map';
|
|
3
|
+
import { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/config';
|
|
4
|
+
|
|
5
|
+
export type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {
|
|
6
|
+
component?: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;
|
|
7
|
+
};
|
|
8
|
+
export type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> & {
|
|
9
|
+
data?: {
|
|
10
|
+
areas?: AreaDatum[];
|
|
11
|
+
points?: PointDatum[];
|
|
12
|
+
links?: LinkDatum[];
|
|
13
|
+
};
|
|
14
|
+
ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;
|
|
15
|
+
};
|
|
16
|
+
export declare const VisTopoJSONMapSelectors: typeof import("@unovis/ts/components/topojson-map/style");
|
|
17
|
+
export declare const VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null);
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { TopoJSONMap } from
|
|
3
|
-
import { arePropsEqual } from
|
|
4
|
-
|
|
5
|
-
const VisTopoJSONMapSelectors = TopoJSONMap.selectors;
|
|
6
|
-
function VisTopoJSONMapFC(props, fRef) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
27
|
-
}
|
|
1
|
+
import React, { useRef, useEffect, useImperativeHandle } from "react";
|
|
2
|
+
import { TopoJSONMap } from "@unovis/ts/components/topojson-map";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
import { useContainerRenderOnUpdate } from "../../utils/container.js";
|
|
5
|
+
const VisTopoJSONMapSelectors = TopoJSONMap.selectors;
|
|
6
|
+
function VisTopoJSONMapFC(props, fRef) {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const componentRef = useRef(void 0);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const element = ref.current;
|
|
11
|
+
const c = new TopoJSONMap(props);
|
|
12
|
+
componentRef.current = c;
|
|
13
|
+
element.__component__ = c;
|
|
14
|
+
return () => {
|
|
15
|
+
componentRef.current = void 0;
|
|
16
|
+
c.destroy();
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const component = componentRef.current;
|
|
21
|
+
if (props.data) component?.setData(props.data);
|
|
22
|
+
component?.setConfig(props);
|
|
23
|
+
});
|
|
24
|
+
useContainerRenderOnUpdate();
|
|
25
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
26
|
+
return componentRef.current;
|
|
27
|
+
} }), []);
|
|
28
|
+
return /* @__PURE__ */ React.createElement("vis-component", { ref });
|
|
29
|
+
}
|
|
28
30
|
const VisTopoJSONMap = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
export {
|
|
32
|
+
VisTopoJSONMap,
|
|
33
|
+
VisTopoJSONMapSelectors
|
|
34
|
+
};
|
|
31
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/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 { TopoJSONMap
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/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 { TopoJSONMap } from '@unovis/ts/components/topojson-map'\nimport { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {\n component?: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;\n}\n\nexport type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> & {\n data?: {areas?: AreaDatum[]; points?: PointDatum[]; links?: LinkDatum[]};\n ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;\n}\n\nexport const VisTopoJSONMapSelectors = TopoJSONMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTopoJSONMapFC<AreaDatum, PointDatum, LinkDatum> (props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>, fRef: ForwardedRef<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>): ReactElement {\n const ref = useRef<VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>>(null)\n const componentRef = useRef<TopoJSONMap<AreaDatum, PointDatum, LinkDatum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>)\n\n const c = new TopoJSONMap<AreaDatum, PointDatum, LinkDatum>(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 if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component 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 VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,0BAA0B,YAAY;AAGnD,SAAS,iBAAoD,OAA8D,MAAuF;AAChN,QAAM,MAAM,OAA2E,IAAI;AAC3F,QAAM,eAAe,OAAkE,MAAS;AAGhG,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAA8C,KAAK;AACjE,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;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,iBAA2I,MAAM,KAAK,MAAM,WAAW,gBAAgB,GAAG,aAAa;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { Treemap
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { Treemap } from '@unovis/ts/components/treemap';
|
|
3
|
+
import { TreemapConfigInterface } from '@unovis/ts/components/treemap/config';
|
|
4
|
+
|
|
5
|
+
export type VisTreemapRef<Datum> = {
|
|
6
|
+
component?: Treemap<Datum>;
|
|
7
|
+
};
|
|
8
|
+
export type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {
|
|
9
|
+
data?: Datum[];
|
|
10
|
+
ref?: Ref<VisTreemapRef<Datum>>;
|
|
11
|
+
};
|
|
12
|
+
export declare const VisTreemapSelectors: typeof import("@unovis/ts/components/treemap/style");
|
|
13
|
+
export declare const VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null);
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { Treemap } from
|
|
3
|
-
import { arePropsEqual } from
|
|
4
|
-
|
|
5
|
-
const VisTreemapSelectors = Treemap.selectors;
|
|
6
|
-
function VisTreemapFC(props, fRef) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
27
|
-
}
|
|
1
|
+
import React, { useRef, useEffect, useImperativeHandle } from "react";
|
|
2
|
+
import { Treemap } from "@unovis/ts/components/treemap";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
import { useContainerRenderOnUpdate } from "../../utils/container.js";
|
|
5
|
+
const VisTreemapSelectors = Treemap.selectors;
|
|
6
|
+
function VisTreemapFC(props, fRef) {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const componentRef = useRef(void 0);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const element = ref.current;
|
|
11
|
+
const c = new Treemap(props);
|
|
12
|
+
componentRef.current = c;
|
|
13
|
+
element.__component__ = c;
|
|
14
|
+
return () => {
|
|
15
|
+
componentRef.current = void 0;
|
|
16
|
+
c.destroy();
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const component = componentRef.current;
|
|
21
|
+
if (props.data) component?.setData(props.data);
|
|
22
|
+
component?.setConfig(props);
|
|
23
|
+
});
|
|
24
|
+
useContainerRenderOnUpdate();
|
|
25
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
26
|
+
return componentRef.current;
|
|
27
|
+
} }), []);
|
|
28
|
+
return /* @__PURE__ */ React.createElement("vis-component", { ref });
|
|
29
|
+
}
|
|
28
30
|
const VisTreemap = React.memo(React.forwardRef(VisTreemapFC), arePropsEqual);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
export {
|
|
32
|
+
VisTreemap,
|
|
33
|
+
VisTreemapSelectors
|
|
34
|
+
};
|
|
31
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/treemap/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 { Treemap
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/treemap/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 { Treemap } from '@unovis/ts/components/treemap'\nimport { TreemapConfigInterface } from '@unovis/ts/components/treemap/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTreemapRef<Datum> = {\n component?: Treemap<Datum>;\n}\n\nexport type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisTreemapRef<Datum>>;\n}\n\nexport const VisTreemapSelectors = Treemap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTreemapFC<Datum> (props: VisTreemapProps<Datum>, fRef: ForwardedRef<VisTreemapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Treemap<Datum>>>(null)\n const componentRef = useRef<Treemap<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Treemap<Datum>>)\n\n const c = new Treemap<Datum>(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 if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component 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 VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTreemapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,sBAAsB,QAAQ;AAG3C,SAAS,aAAqB,OAA+B,MAAwD;AACnH,QAAM,MAAM,OAA4C,IAAI;AAC5D,QAAM,eAAe,OAAmC,MAAS;AAGjE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAe,KAAK;AAClC,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;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,aAA6E,MAAM,KAAK,MAAM,WAAW,YAAY,GAAG,aAAa;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { XYLabels
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { XYLabels } from '@unovis/ts/components/xy-labels';
|
|
3
|
+
import { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/config';
|
|
4
|
+
|
|
5
|
+
export type VisXYLabelsRef<Datum> = {
|
|
6
|
+
component?: XYLabels<Datum>;
|
|
7
|
+
};
|
|
8
|
+
export type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {
|
|
9
|
+
data?: Datum[];
|
|
10
|
+
ref?: Ref<VisXYLabelsRef<Datum>>;
|
|
11
|
+
};
|
|
12
|
+
export declare const VisXYLabelsSelectors: typeof import("@unovis/ts/components/xy-labels/style");
|
|
13
|
+
export declare const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null);
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { XYLabels } from
|
|
3
|
-
import { arePropsEqual } from
|
|
4
|
-
|
|
5
|
-
const VisXYLabelsSelectors = XYLabels.selectors;
|
|
6
|
-
function VisXYLabelsFC(props, fRef) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
27
|
-
}
|
|
1
|
+
import React, { useRef, useEffect, useImperativeHandle } from "react";
|
|
2
|
+
import { XYLabels } from "@unovis/ts/components/xy-labels";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
import { useContainerRenderOnUpdate } from "../../utils/container.js";
|
|
5
|
+
const VisXYLabelsSelectors = XYLabels.selectors;
|
|
6
|
+
function VisXYLabelsFC(props, fRef) {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const componentRef = useRef(void 0);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const element = ref.current;
|
|
11
|
+
const c = new XYLabels(props);
|
|
12
|
+
componentRef.current = c;
|
|
13
|
+
element.__component__ = c;
|
|
14
|
+
return () => {
|
|
15
|
+
componentRef.current = void 0;
|
|
16
|
+
c.destroy();
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const component = componentRef.current;
|
|
21
|
+
if (props.data) component?.setData(props.data);
|
|
22
|
+
component?.setConfig(props);
|
|
23
|
+
});
|
|
24
|
+
useContainerRenderOnUpdate();
|
|
25
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
26
|
+
return componentRef.current;
|
|
27
|
+
} }), []);
|
|
28
|
+
return /* @__PURE__ */ React.createElement("vis-component", { ref });
|
|
29
|
+
}
|
|
28
30
|
const VisXYLabels = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
export {
|
|
32
|
+
VisXYLabels,
|
|
33
|
+
VisXYLabelsSelectors
|
|
34
|
+
};
|
|
31
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/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 { XYLabels
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/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 { XYLabels } from '@unovis/ts/components/xy-labels'\nimport { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYLabelsRef<Datum> = {\n component?: XYLabels<Datum>;\n}\n\nexport type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisXYLabelsRef<Datum>>;\n}\n\nexport const VisXYLabelsSelectors = XYLabels.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisXYLabelsFC<Datum> (props: VisXYLabelsProps<Datum>, fRef: ForwardedRef<VisXYLabelsRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<XYLabels<Datum>>>(null)\n const componentRef = useRef<XYLabels<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n\n const c = new XYLabels<Datum>(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 if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component 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 VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAGlE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,KAAK;AACnC,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;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,cAA+E,MAAM,KAAK,MAAM,WAAW,aAAa,GAAG,aAAa;"}
|
package/components.d.ts
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
export * from './components/line';
|
|
2
|
-
export * from './components/area';
|
|
3
|
-
export * from './components/axis';
|
|
4
|
-
export * from './components/
|
|
5
|
-
export * from './components/
|
|
6
|
-
export * from './components/
|
|
7
|
-
export * from './components/
|
|
8
|
-
export * from './components/
|
|
9
|
-
export * from './components/
|
|
10
|
-
export * from './components/
|
|
11
|
-
export * from './components/
|
|
12
|
-
export * from './components/
|
|
13
|
-
export * from './components/
|
|
14
|
-
export * from './components/
|
|
15
|
-
export * from './components/
|
|
16
|
-
export * from './components/
|
|
17
|
-
export * from './components/
|
|
18
|
-
export * from './components/
|
|
19
|
-
export * from './components/
|
|
20
|
-
export * from './components/
|
|
21
|
-
export * from './components/
|
|
22
|
-
export * from './components/
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './html-components/
|
|
27
|
-
export * from './html-components/
|
|
1
|
+
export * from './components/line';
|
|
2
|
+
export * from './components/area';
|
|
3
|
+
export * from './components/axis';
|
|
4
|
+
export * from './components/boxplot';
|
|
5
|
+
export * from './components/brush/';
|
|
6
|
+
export * from './components/chord-diagram';
|
|
7
|
+
export * from './components/crosshair';
|
|
8
|
+
export * from './components/donut';
|
|
9
|
+
export * from './components/free-brush';
|
|
10
|
+
export * from './components/graph';
|
|
11
|
+
export * from './components/grouped-bar/';
|
|
12
|
+
export * from './components/heatmap';
|
|
13
|
+
export * from './components/nested-donut';
|
|
14
|
+
export * from './components/scatter/';
|
|
15
|
+
export * from './components/sankey';
|
|
16
|
+
export * from './components/stacked-bar/';
|
|
17
|
+
export * from './components/tooltip/';
|
|
18
|
+
export * from './components/timeline/';
|
|
19
|
+
export * from './components/topojson-map/';
|
|
20
|
+
export * from './components/xy-labels';
|
|
21
|
+
export * from './components/annotations';
|
|
22
|
+
export * from './components/plotband';
|
|
23
|
+
export * from './components/treemap';
|
|
24
|
+
export * from './components/plotline';
|
|
25
|
+
export * from './components/radial-bar';
|
|
26
|
+
export * from './html-components/bullet-legend';
|
|
27
|
+
export * from './html-components/rolling-pin-legend';
|
|
28
|
+
export * from './html-components/leaflet-map';
|
|
29
|
+
export * from './html-components/leaflet-flow-map';
|
|
30
|
+
export * from './html-components/flow-legend';
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { Spacing } from '@unovis/ts';
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export declare
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
1
|
+
import { Spacing } from '@unovis/ts/types/spacing';
|
|
2
|
+
|
|
3
|
+
export type VisTimeSeriesDatum = {
|
|
4
|
+
timestamp: number;
|
|
5
|
+
value: number;
|
|
6
|
+
id?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
export type VisTimeSeriesProps<Datum> = {
|
|
10
|
+
data: Datum[];
|
|
11
|
+
margin: Spacing;
|
|
12
|
+
autoMargin: boolean;
|
|
13
|
+
x: (d: Datum, i: number) => number;
|
|
14
|
+
y: (d: Datum, i: number) => number;
|
|
15
|
+
id: (d: Datum, i: number) => string;
|
|
16
|
+
color: (d: Datum[], i: number) => string | null;
|
|
17
|
+
cursor: string | ((d: Datum, i: number) => string);
|
|
18
|
+
formatXTicks?: (timestamp: number) => string;
|
|
19
|
+
formatYTicks?: (timestamp: number) => string;
|
|
20
|
+
selectionMinLength: number;
|
|
21
|
+
onBrushStart?: (selection: [number, number], e?: {
|
|
22
|
+
sourceEvent: MouseEvent;
|
|
23
|
+
}, userDriven?: boolean) => void;
|
|
24
|
+
onBrushMove?: (selection: [number, number], e?: {
|
|
25
|
+
sourceEvent: MouseEvent;
|
|
26
|
+
}, userDriven?: boolean) => void;
|
|
27
|
+
onBrushEnd?: (selection: [number, number], e?: {
|
|
28
|
+
sourceEvent: MouseEvent;
|
|
29
|
+
}, userDriven?: boolean) => void;
|
|
30
|
+
formatNavXTicks?: (timestamp: number) => string;
|
|
31
|
+
xLabel?: string;
|
|
32
|
+
yLabel?: string;
|
|
33
|
+
crosshairTemplate?: (d: Datum) => string | HTMLElement;
|
|
34
|
+
className?: string;
|
|
35
|
+
height?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare function VisTimeSeries<Datum>(props: VisTimeSeriesProps<Datum>): JSX.Element;
|
|
38
|
+
export declare namespace VisTimeSeries {
|
|
39
|
+
var defaultProps: {
|
|
40
|
+
margin: {
|
|
41
|
+
top: number;
|
|
42
|
+
bottom: number;
|
|
43
|
+
left: number;
|
|
44
|
+
right: number;
|
|
45
|
+
};
|
|
46
|
+
autoMargin: boolean;
|
|
47
|
+
padding: {};
|
|
48
|
+
x: (d: VisTimeSeriesDatum) => number;
|
|
49
|
+
y: (d: VisTimeSeriesDatum) => number;
|
|
50
|
+
id: (d: VisTimeSeriesDatum) => string | undefined;
|
|
51
|
+
color: (d: VisTimeSeriesDatum[]) => null;
|
|
52
|
+
formatYTicks: (d: number) => string;
|
|
53
|
+
crosshairTemplate: (d: VisTimeSeriesDatum) => string;
|
|
54
|
+
};
|
|
55
|
+
}
|