@unovis/react 1.6.7 → 1.7.0-beta.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 -11
- package/components/annotations/index.js +32 -27
- package/components/annotations/index.js.map +1 -1
- package/components/area/index.d.ts +13 -12
- package/components/area/index.js +33 -29
- package/components/area/index.js.map +1 -1
- package/components/axis/index.d.ts +13 -12
- 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 -12
- package/components/brush/index.js +33 -29
- package/components/brush/index.js.map +1 -1
- package/components/chord-diagram/index.d.ts +17 -16
- package/components/chord-diagram/index.js +33 -29
- package/components/chord-diagram/index.js.map +1 -1
- package/components/crosshair/index.d.ts +13 -12
- package/components/crosshair/index.js +33 -29
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/index.d.ts +13 -12
- package/components/donut/index.js +33 -29
- package/components/donut/index.js.map +1 -1
- package/components/free-brush/index.d.ts +13 -12
- package/components/free-brush/index.js +33 -29
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/index.d.ts +39 -38
- package/components/graph/index.js +33 -29
- package/components/graph/index.js.map +1 -1
- package/components/grouped-bar/index.d.ts +13 -12
- 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 -12
- package/components/line/index.js +33 -29
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/index.d.ts +13 -12
- package/components/nested-donut/index.js +33 -29
- package/components/nested-donut/index.js.map +1 -1
- package/components/plotband/index.d.ts +12 -11
- package/components/plotband/index.js +32 -27
- package/components/plotband/index.js.map +1 -1
- package/components/plotline/index.d.ts +12 -11
- 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 -16
- package/components/sankey/index.js +33 -29
- package/components/sankey/index.js.map +1 -1
- package/components/scatter/index.d.ts +13 -12
- package/components/scatter/index.js +33 -29
- package/components/scatter/index.js.map +1 -1
- package/components/stacked-bar/index.d.ts +13 -12
- package/components/stacked-bar/index.js +33 -29
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/index.d.ts +13 -12
- package/components/timeline/index.js +33 -29
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/index.d.ts +12 -11
- package/components/tooltip/index.js +32 -27
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/index.d.ts +17 -16
- package/components/topojson-map/index.js +33 -29
- package/components/topojson-map/index.js.map +1 -1
- package/components/treemap/index.d.ts +13 -12
- package/components/treemap/index.js +33 -29
- package/components/treemap/index.js.map +1 -1
- package/components/xy-labels/index.d.ts +13 -12
- 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 -61
- 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 -59
- package/containers/xy-container/index.js.map +1 -1
- package/containers.d.ts +2 -2
- package/html-components/bullet-legend/index.d.ts +13 -12
- 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 -12
- 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 -17
- 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 -14
- 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 -12
- 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 +15 -16
- 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/.pnpm/style-inject@0.3.0/external/style-inject/dist/style-inject.es.js +0 -29
- package/external/.pnpm/style-inject@0.3.0/external/style-inject/dist/style-inject.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/containers/xy-container/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport React, { ReactNode, useEffect, useRef, useState, PropsWithChildren } from 'react'\nimport { XYContainer } from '@unovis/ts/containers/xy-container'\nimport { XYContainerConfigInterface } from '@unovis/ts/containers/xy-container/config'\nimport { XYComponentCore } from '@unovis/ts/core/xy-component'\nimport { Tooltip } from '@unovis/ts/components/tooltip'\nimport { Crosshair } from '@unovis/ts/components/crosshair'\nimport { Axis } from '@unovis/ts/components/axis'\nimport { AxisType } from '@unovis/ts/components/axis/types'\nimport { Annotations } from '@unovis/ts/components/annotations'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYContainerProps<Datum> = XYContainerConfigInterface<Datum> & {\n data?: Datum[];\n className?: string;\n style?: React.CSSProperties | Record<`--${string}`, string | number>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisXYContainerFC<Datum> (props: PropsWithChildren<VisXYContainerProps<Datum>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const prevPropsRef = useRef<PropsWithChildren<VisXYContainerProps<Datum>>>({})\n const chartRef = useRef<XYContainer<Datum> | undefined>(undefined)\n const dataRef = useRef<Datum[] | undefined>(undefined)\n const animationFrameRef = useRef<number | null>(null)\n\n const getConfig = (): XYContainerConfigInterface<Datum> => ({\n components: Array\n .from(container.current?.querySelectorAll<VisComponentElement<XYComponentCore<Datum>>>('vis-component') ?? [])\n .map(c => c.__component__)\n .filter(Boolean) as XYComponentCore<Datum>[],\n tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n crosshair: container.current?.querySelector<VisComponentElement<Crosshair<Datum>>>('vis-crosshair')?.__component__,\n annotations: container.current?.querySelector<VisComponentElement<Annotations>>('vis-annotations')?.__component__,\n xAxis: Array\n .from(container.current?.querySelectorAll<VisComponentElement<Axis<Datum>>>('vis-axis') ?? [])\n .map(c => c.__component__)\n .find(c => c.config.type === AxisType.X),\n yAxis: Array\n .from(container.current?.querySelectorAll<VisComponentElement<Axis<Datum>>>('vis-axis') ?? [])\n .map(c => c.__component__)\n .find(c => c.config.type === AxisType.Y),\n margin: { top: 5, left: 5, right: 5, bottom: 5 },\n ...props,\n })\n\n // On Mount\n useEffect(() => {\n const c = new XYContainer<Datum>(container.current as HTMLDivElement, getConfig(), props.data)\n chartRef.current = c\n prevPropsRef.current = props\n dataRef.current = props.data\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = null\n prevPropsRef.current = {}\n }\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== dataRef.current)) {\n chartRef.current?.setData(props.data, preventRender)\n dataRef.current = props.data\n }\n\n // Update and render\n // ! Experimental: we use `requestAnimationFrame` to make the wrapper compatible with React 18 Strict Mode.\n // React 18 in Strict Mode renders components twice. At the same time, this container will get updated only after\n // the first render of its children (VisLine, VisArea, ...) meaning that their wrong instances (the ones\n // that will be destroyed soon) are stored in the `__component__` property of their elements at that moment.\n // So we delay the container update with `requestAnimationFrame` to wait till the new instances of children\n // components are available at `__component__`.\n if (!arePropsEqual(prevPropsRef.current, props)) { // Checking whether the props have changed do avoid multiple renders\n prevPropsRef.current = props\n if (animationFrameRef.current) cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = requestAnimationFrame(() => {\n chartRef.current?.updateContainer(getConfig())\n })\n }\n })\n\n return (\n <div ref={container} className={props.className} style={props.style}>\n {props.children}\n </div>\n )\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 VisXYContainer: (<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>) => JSX.Element | null) =\n React.memo(VisXYContainerFC, arePropsEqual)\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/containers/xy-container/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport React, { ReactNode, useEffect, useMemo, useRef, useState, PropsWithChildren } from 'react'\nimport { XYContainer } from '@unovis/ts/containers/xy-container'\nimport { XYContainerConfigInterface } from '@unovis/ts/containers/xy-container/config'\nimport { XYComponentCore } from '@unovis/ts/core/xy-component'\nimport { Tooltip } from '@unovis/ts/components/tooltip'\nimport { Crosshair } from '@unovis/ts/components/crosshair'\nimport { Axis } from '@unovis/ts/components/axis'\nimport { AxisType } from '@unovis/ts/components/axis/types'\nimport { Annotations } from '@unovis/ts/components/annotations'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { VisContainerContext, VisContainerContextValue } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYContainerProps<Datum> = XYContainerConfigInterface<Datum> & {\n data?: Datum[];\n className?: string;\n style?: React.CSSProperties | Record<`--${string}`, string | number>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisXYContainerFC<Datum> (props: PropsWithChildren<VisXYContainerProps<Datum>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const prevPropsRef = useRef<PropsWithChildren<VisXYContainerProps<Datum>>>({})\n const chartRef = useRef<XYContainer<Datum> | undefined>(undefined)\n const dataRef = useRef<Datum[] | undefined>(undefined)\n const animationFrameRef = useRef<number | null>(null)\n const renderRequestFrameRef = useRef<number | null>(null)\n\n // Children ask for a re-render when their own config changes. We coalesce the requests into a single\n // frame, and skip them when this container's props changed too, because the `updateContainer` call\n // scheduled below renders on its own.\n const containerContext = useMemo<VisContainerContextValue>(() => ({\n requestRender: () => {\n if (renderRequestFrameRef.current !== null) return\n renderRequestFrameRef.current = requestAnimationFrame(() => {\n renderRequestFrameRef.current = null\n if (animationFrameRef.current !== null) return\n chartRef.current?.render()\n })\n },\n }), [])\n\n const getConfig = (): XYContainerConfigInterface<Datum> => ({\n components: Array\n .from(container.current?.querySelectorAll<VisComponentElement<XYComponentCore<Datum>>>('vis-component') ?? [])\n .map(c => c.__component__)\n .filter(Boolean) as XYComponentCore<Datum>[],\n tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n crosshair: container.current?.querySelector<VisComponentElement<Crosshair<Datum>>>('vis-crosshair')?.__component__,\n annotations: container.current?.querySelector<VisComponentElement<Annotations>>('vis-annotations')?.__component__,\n xAxis: Array\n .from(container.current?.querySelectorAll<VisComponentElement<Axis<Datum>>>('vis-axis') ?? [])\n .map(c => c.__component__)\n .find(c => c.config.type === AxisType.X),\n yAxis: Array\n .from(container.current?.querySelectorAll<VisComponentElement<Axis<Datum>>>('vis-axis') ?? [])\n .map(c => c.__component__)\n .find(c => c.config.type === AxisType.Y),\n margin: { top: 5, left: 5, right: 5, bottom: 5 },\n ...props,\n })\n\n // On Mount\n useEffect(() => {\n const c = new XYContainer<Datum>(container.current as HTMLDivElement, getConfig(), props.data)\n chartRef.current = c\n prevPropsRef.current = props\n dataRef.current = props.data\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = null\n prevPropsRef.current = {}\n }\n if (renderRequestFrameRef.current !== null) {\n cancelAnimationFrame(renderRequestFrameRef.current)\n renderRequestFrameRef.current = null\n }\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== dataRef.current)) {\n chartRef.current?.setData(props.data, preventRender)\n dataRef.current = props.data\n }\n\n // Update and render\n // ! Experimental: we use `requestAnimationFrame` to make the wrapper compatible with React 18 Strict Mode.\n // React 18 in Strict Mode renders components twice. At the same time, this container will get updated only after\n // the first render of its children (VisLine, VisArea, ...) meaning that their wrong instances (the ones\n // that will be destroyed soon) are stored in the `__component__` property of their elements at that moment.\n // So we delay the container update with `requestAnimationFrame` to wait till the new instances of children\n // components are available at `__component__`.\n if (!arePropsEqual(prevPropsRef.current, props)) { // Checking whether the props have changed do avoid multiple renders\n prevPropsRef.current = props\n if (animationFrameRef.current) cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = requestAnimationFrame(() => {\n animationFrameRef.current = null\n chartRef.current?.updateContainer(getConfig())\n })\n }\n })\n\n return (\n <div ref={container} className={props.className} style={props.style}>\n <VisContainerContext.Provider value={containerContext}>\n {props.children}\n </VisContainerContext.Provider>\n </div>\n )\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 VisXYContainer: (<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>) => JSX.Element | null) =\n React.memo(VisXYContainerFC, arePropsEqual)\n"],"names":[],"mappings":";;;;;AAyBO,SAAS,iBAAyB,OAAmE;AAC1G,QAAM,YAAY,OAAuB,IAAI;AAC7C,QAAM,eAAe,OAAsD,EAAE;AAC7E,QAAM,WAAW,OAAuC,MAAS;AACjE,QAAM,UAAU,OAA4B,MAAS;AACrD,QAAM,oBAAoB,OAAsB,IAAI;AACpD,QAAM,wBAAwB,OAAsB,IAAI;AAKxD,QAAM,mBAAmB,QAAkC,OAAO;AAAA,IAChE,eAAe,MAAM;AACnB,UAAI,sBAAsB,YAAY,KAAM;AAC5C,4BAAsB,UAAU,sBAAsB,MAAM;AAC1D,8BAAsB,UAAU;AAChC,YAAI,kBAAkB,YAAY,KAAM;AACxC,iBAAS,SAAS,OAAA;AAAA,MACpB,CAAC;AAAA,IACH;AAAA,EAAA,IACE,CAAA,CAAE;AAEN,QAAM,YAAY,OAA0C;AAAA,IAC1D,YAAY,MACT,KAAK,UAAU,SAAS,iBAA8D,eAAe,KAAK,CAAA,CAAE,EAC5G,IAAI,CAAA,MAAK,EAAE,aAAa,EACxB,OAAO,OAAO;AAAA,IACjB,SAAS,UAAU,SAAS,cAA4C,aAAa,GAAG;AAAA,IACxF,WAAW,UAAU,SAAS,cAAqD,eAAe,GAAG;AAAA,IACrG,aAAa,UAAU,SAAS,cAAgD,iBAAiB,GAAG;AAAA,IACpG,OAAO,MACJ,KAAK,UAAU,SAAS,iBAAmD,UAAU,KAAK,EAAE,EAC5F,IAAI,CAAA,MAAK,EAAE,aAAa,EACxB,KAAK,OAAK,EAAE,OAAO,SAAS,SAAS,CAAC;AAAA,IACzC,OAAO,MACJ,KAAK,UAAU,SAAS,iBAAmD,UAAU,KAAK,EAAE,EAC5F,IAAI,CAAA,MAAK,EAAE,aAAa,EACxB,KAAK,OAAK,EAAE,OAAO,SAAS,SAAS,CAAC;AAAA,IACzC,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,EAAA;AAAA,IAC7C,GAAG;AAAA,EAAA;AAIL,YAAU,MAAM;AACd,UAAM,IAAI,IAAI,YAAmB,UAAU,SAA2B,UAAA,GAAa,MAAM,IAAI;AAC7F,aAAS,UAAU;AACnB,iBAAa,UAAU;AACvB,YAAQ,UAAU,MAAM;AAExB,WAAO,MAAM;AACX,UAAI,kBAAkB,SAAS;AAC7B,6BAAqB,kBAAkB,OAAO;AAC9C,0BAAkB,UAAU;AAC5B,qBAAa,UAAU,CAAA;AAAA,MACzB;AACA,UAAI,sBAAsB,YAAY,MAAM;AAC1C,6BAAqB,sBAAsB,OAAO;AAClD,8BAAsB,UAAU;AAAA,MAClC;AACA,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,gBAAgB;AAGtB,QAAI,MAAM,QAAS,MAAM,SAAS,QAAQ,SAAU;AAClD,eAAS,SAAS,QAAQ,MAAM,MAAM,aAAa;AACnD,cAAQ,UAAU,MAAM;AAAA,IAC1B;AASA,QAAI,CAAC,cAAc,aAAa,SAAS,KAAK,GAAG;AAC/C,mBAAa,UAAU;AACvB,UAAI,kBAAkB,QAAS,sBAAqB,kBAAkB,OAAO;AAC7E,wBAAkB,UAAU,sBAAsB,MAAM;AACtD,0BAAkB,UAAU;AAC5B,iBAAS,SAAS,gBAAgB,WAAW;AAAA,MAC/C,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AAED,6CACG,OAAA,EAAI,KAAK,WAAW,WAAW,MAAM,WAAW,OAAO,MAAM,MAAA,GAC5D,sBAAA,cAAC,oBAAoB,UAApB,EAA6B,OAAO,iBAAA,GAClC,MAAM,QACT,CACF;AAEJ;AAIO,MAAM,iBACX,MAAM,KAAK,kBAAkB,aAAa;"}
|
package/containers.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './containers/xy-container';
|
|
2
|
-
export * from './containers/single-container';
|
|
1
|
+
export * from './containers/xy-container';
|
|
2
|
+
export * from './containers/single-container';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { BulletLegend } from '@unovis/ts/components/bullet-legend';
|
|
3
|
-
import { BulletLegendConfigInterface } from '@unovis/ts/components/bullet-legend/config';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { BulletLegend } from '@unovis/ts/components/bullet-legend';
|
|
3
|
+
import { BulletLegendConfigInterface } from '@unovis/ts/components/bullet-legend/config';
|
|
4
|
+
|
|
5
|
+
export type VisBulletLegendRef = {
|
|
6
|
+
component?: BulletLegend;
|
|
7
|
+
};
|
|
8
|
+
export type VisBulletLegendProps = BulletLegendConfigInterface & {
|
|
9
|
+
ref?: Ref<VisBulletLegendRef>;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const VisBulletLegendSelectors: typeof import("@unovis/ts/components/bullet-legend/style");
|
|
13
|
+
export declare const VisBulletLegend: ((props: VisBulletLegendProps) => JSX.Element | null);
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { BulletLegend } 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 { BulletLegend } from "@unovis/ts/components/bullet-legend";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
const VisBulletLegendSelectors = BulletLegend.selectors;
|
|
5
|
+
function VisBulletLegendFC(props, fRef) {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const componentRef = useRef(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
const c = new BulletLegend(ref.current, { ...props, renderIntoProvidedDomNode: true });
|
|
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 VisBulletLegend = React.memo(React.forwardRef(VisBulletLegendFC), arePropsEqual);
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
export {
|
|
29
|
+
VisBulletLegend,
|
|
30
|
+
VisBulletLegendSelectors
|
|
31
|
+
};
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/html-components/bullet-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 { BulletLegend } from '@unovis/ts/components/bullet-legend'\nimport { BulletLegendConfigInterface } from '@unovis/ts/components/bullet-legend/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisBulletLegendRef = {\n component?: BulletLegend;\n}\n\nexport type VisBulletLegendProps = BulletLegendConfigInterface & {\n ref?: Ref<VisBulletLegendRef>;\n className?: string;\n}\n\nexport const VisBulletLegendSelectors = BulletLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBulletLegendFC (props: VisBulletLegendProps, fRef: ForwardedRef<VisBulletLegendRef>): ReactElement {\n const ref = useRef<VisComponentElement<BulletLegend, HTMLDivElement>>(null)\n const componentRef = useRef<BulletLegend | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<BulletLegend, HTMLDivElement>)\n\n const c = new BulletLegend(ref.current as VisComponentElement<BulletLegend, HTMLDivElement>, { ...props, renderIntoProvidedDomNode: true })\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 VisBulletLegend: ((props: VisBulletLegendProps) => JSX.Element | null) = React.memo(React.forwardRef(VisBulletLegendFC), arePropsEqual)\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/html-components/bullet-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 { BulletLegend } from '@unovis/ts/components/bullet-legend'\nimport { BulletLegendConfigInterface } from '@unovis/ts/components/bullet-legend/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisBulletLegendRef = {\n component?: BulletLegend;\n}\n\nexport type VisBulletLegendProps = BulletLegendConfigInterface & {\n ref?: Ref<VisBulletLegendRef>;\n className?: string;\n}\n\nexport const VisBulletLegendSelectors = BulletLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBulletLegendFC (props: VisBulletLegendProps, fRef: ForwardedRef<VisBulletLegendRef>): ReactElement {\n const ref = useRef<VisComponentElement<BulletLegend, HTMLDivElement>>(null)\n const componentRef = useRef<BulletLegend | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<BulletLegend, HTMLDivElement>)\n\n const c = new BulletLegend(ref.current as VisComponentElement<BulletLegend, HTMLDivElement>, { ...props, renderIntoProvidedDomNode: true })\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 VisBulletLegend: ((props: VisBulletLegendProps) => JSX.Element | null) = React.memo(React.forwardRef(VisBulletLegendFC), arePropsEqual)\n"],"names":[],"mappings":";;;AAoBO,MAAM,2BAA2B,aAAa;AAGrD,SAAS,kBAAmB,OAA6B,MAAsD;AAC7G,QAAM,MAAM,OAA0D,IAAI;AAC1E,QAAM,eAAe,OAAiC,MAAS;AAG/D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,aAAa,IAAI,SAA8D,EAAE,GAAG,OAAO,2BAA2B,MAAM;AAC1I,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,kBAAyE,MAAM,KAAK,MAAM,WAAW,iBAAiB,GAAG,aAAa;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { FlowLegend } from '@unovis/ts/components/flow-legend';
|
|
3
|
-
import { FlowLegendConfigInterface } from '@unovis/ts/components/flow-legend/config';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { FlowLegend } from '@unovis/ts/components/flow-legend';
|
|
3
|
+
import { FlowLegendConfigInterface } from '@unovis/ts/components/flow-legend/config';
|
|
4
|
+
|
|
5
|
+
export type VisFlowLegendRef = {
|
|
6
|
+
component?: FlowLegend;
|
|
7
|
+
};
|
|
8
|
+
export type VisFlowLegendProps = FlowLegendConfigInterface & {
|
|
9
|
+
ref?: Ref<VisFlowLegendRef>;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const VisFlowLegendSelectors: typeof import("@unovis/ts/components/flow-legend/style");
|
|
13
|
+
export declare const VisFlowLegend: ((props: VisFlowLegendProps) => JSX.Element | null);
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { FlowLegend } 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 { FlowLegend } from "@unovis/ts/components/flow-legend";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
const VisFlowLegendSelectors = FlowLegend.selectors;
|
|
5
|
+
function VisFlowLegendFC(props, fRef) {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const componentRef = useRef(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
const c = new FlowLegend(ref.current, { ...props, renderIntoProvidedDomNode: true });
|
|
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 VisFlowLegend = React.memo(React.forwardRef(VisFlowLegendFC), arePropsEqual);
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
export {
|
|
29
|
+
VisFlowLegend,
|
|
30
|
+
VisFlowLegendSelectors
|
|
31
|
+
};
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/html-components/flow-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 { FlowLegend } from '@unovis/ts/components/flow-legend'\nimport { FlowLegendConfigInterface } from '@unovis/ts/components/flow-legend/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisFlowLegendRef = {\n component?: FlowLegend;\n}\n\nexport type VisFlowLegendProps = FlowLegendConfigInterface & {\n ref?: Ref<VisFlowLegendRef>;\n className?: string;\n}\n\nexport const VisFlowLegendSelectors = FlowLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisFlowLegendFC (props: VisFlowLegendProps, fRef: ForwardedRef<VisFlowLegendRef>): ReactElement {\n const ref = useRef<VisComponentElement<FlowLegend, HTMLDivElement>>(null)\n const componentRef = useRef<FlowLegend | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<FlowLegend, HTMLDivElement>)\n\n const c = new FlowLegend(ref.current as VisComponentElement<FlowLegend, HTMLDivElement>, { ...props, renderIntoProvidedDomNode: true })\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 VisFlowLegend: ((props: VisFlowLegendProps) => JSX.Element | null) = React.memo(React.forwardRef(VisFlowLegendFC), arePropsEqual)\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/html-components/flow-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 { FlowLegend } from '@unovis/ts/components/flow-legend'\nimport { FlowLegendConfigInterface } from '@unovis/ts/components/flow-legend/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisFlowLegendRef = {\n component?: FlowLegend;\n}\n\nexport type VisFlowLegendProps = FlowLegendConfigInterface & {\n ref?: Ref<VisFlowLegendRef>;\n className?: string;\n}\n\nexport const VisFlowLegendSelectors = FlowLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisFlowLegendFC (props: VisFlowLegendProps, fRef: ForwardedRef<VisFlowLegendRef>): ReactElement {\n const ref = useRef<VisComponentElement<FlowLegend, HTMLDivElement>>(null)\n const componentRef = useRef<FlowLegend | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<FlowLegend, HTMLDivElement>)\n\n const c = new FlowLegend(ref.current as VisComponentElement<FlowLegend, HTMLDivElement>, { ...props, renderIntoProvidedDomNode: true })\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 VisFlowLegend: ((props: VisFlowLegendProps) => JSX.Element | null) = React.memo(React.forwardRef(VisFlowLegendFC), arePropsEqual)\n"],"names":[],"mappings":";;;AAoBO,MAAM,yBAAyB,WAAW;AAGjD,SAAS,gBAAiB,OAA2B,MAAoD;AACvG,QAAM,MAAM,OAAwD,IAAI;AACxE,QAAM,eAAe,OAA+B,MAAS;AAG7D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,WAAW,IAAI,SAA4D,EAAE,GAAG,OAAO,2BAA2B,MAAM;AACtI,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,gBAAqE,MAAM,KAAK,MAAM,WAAW,eAAe,GAAG,aAAa;"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { LeafletFlowMap } from '@unovis/ts/components/leaflet-flow-map';
|
|
3
|
-
import { LeafletFlowMapConfigInterface } from '@unovis/ts/components/leaflet-flow-map/config';
|
|
4
|
-
import { GenericDataRecord } from '@unovis/ts/types/data';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare const
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { LeafletFlowMap } from '@unovis/ts/components/leaflet-flow-map';
|
|
3
|
+
import { LeafletFlowMapConfigInterface } from '@unovis/ts/components/leaflet-flow-map/config';
|
|
4
|
+
import { GenericDataRecord } from '@unovis/ts/types/data';
|
|
5
|
+
|
|
6
|
+
export type VisLeafletFlowMapRef<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = {
|
|
7
|
+
component?: LeafletFlowMap<PointDatum, FlowDatum>;
|
|
8
|
+
};
|
|
9
|
+
export type VisLeafletFlowMapProps<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {
|
|
10
|
+
data?: {
|
|
11
|
+
points: PointDatum[];
|
|
12
|
+
flows?: FlowDatum[];
|
|
13
|
+
};
|
|
14
|
+
ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const VisLeafletFlowMapSelectors: typeof import("@unovis/ts/components/leaflet-map/style");
|
|
18
|
+
export declare const VisLeafletFlowMap: (<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null);
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { LeafletFlowMap } 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
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
1
|
+
import React, { useRef, useEffect, useImperativeHandle } from "react";
|
|
2
|
+
import { LeafletFlowMap } from "@unovis/ts/components/leaflet-flow-map";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
const VisLeafletFlowMapSelectors = LeafletFlowMap.selectors;
|
|
5
|
+
function VisLeafletFlowMapFC(props, fRef) {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const componentRef = useRef(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
const c = new LeafletFlowMap(ref.current, props, props.data);
|
|
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
|
+
if (props.data) component?.setData(props.data);
|
|
21
|
+
component?.setConfig(props);
|
|
22
|
+
});
|
|
23
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
24
|
+
return componentRef.current;
|
|
25
|
+
} }), []);
|
|
26
|
+
return /* @__PURE__ */ React.createElement("div", { className: props.className, ref });
|
|
27
|
+
}
|
|
28
28
|
const VisLeafletFlowMap = React.memo(React.forwardRef(VisLeafletFlowMapFC), arePropsEqual);
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
export {
|
|
30
|
+
VisLeafletFlowMap,
|
|
31
|
+
VisLeafletFlowMapSelectors
|
|
32
|
+
};
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-flow-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 { LeafletFlowMap } from '@unovis/ts/components/leaflet-flow-map'\nimport { LeafletFlowMapConfigInterface } from '@unovis/ts/components/leaflet-flow-map/config'\nimport { GenericDataRecord } from '@unovis/ts/types/data'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisLeafletFlowMapRef<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = {\n component?: LeafletFlowMap<PointDatum, FlowDatum>;\n}\n\nexport type VisLeafletFlowMapProps<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {\n data?: { points: PointDatum[]; flows?: FlowDatum[] };\n ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;\n className?: string;\n}\n\nexport const VisLeafletFlowMapSelectors = LeafletFlowMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLeafletFlowMapFC<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> (props: VisLeafletFlowMapProps<PointDatum, FlowDatum>, fRef: ForwardedRef<VisLeafletFlowMapRef<PointDatum, FlowDatum>>): ReactElement {\n const ref = useRef<VisComponentElement<LeafletFlowMap<PointDatum, FlowDatum>, HTMLDivElement>>(null)\n const componentRef = useRef<LeafletFlowMap<PointDatum, FlowDatum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<LeafletFlowMap<PointDatum, FlowDatum>, HTMLDivElement>)\n\n const c = new LeafletFlowMap<PointDatum, FlowDatum>(ref.current as VisComponentElement<LeafletFlowMap<PointDatum, FlowDatum>, HTMLDivElement>, props, props.data)\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 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 VisLeafletFlowMap: (<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLeafletFlowMapFC), arePropsEqual)\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-flow-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 { LeafletFlowMap } from '@unovis/ts/components/leaflet-flow-map'\nimport { LeafletFlowMapConfigInterface } from '@unovis/ts/components/leaflet-flow-map/config'\nimport { GenericDataRecord } from '@unovis/ts/types/data'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisLeafletFlowMapRef<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = {\n component?: LeafletFlowMap<PointDatum, FlowDatum>;\n}\n\nexport type VisLeafletFlowMapProps<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {\n data?: { points: PointDatum[]; flows?: FlowDatum[] };\n ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;\n className?: string;\n}\n\nexport const VisLeafletFlowMapSelectors = LeafletFlowMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLeafletFlowMapFC<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> (props: VisLeafletFlowMapProps<PointDatum, FlowDatum>, fRef: ForwardedRef<VisLeafletFlowMapRef<PointDatum, FlowDatum>>): ReactElement {\n const ref = useRef<VisComponentElement<LeafletFlowMap<PointDatum, FlowDatum>, HTMLDivElement>>(null)\n const componentRef = useRef<LeafletFlowMap<PointDatum, FlowDatum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<LeafletFlowMap<PointDatum, FlowDatum>, HTMLDivElement>)\n\n const c = new LeafletFlowMap<PointDatum, FlowDatum>(ref.current as VisComponentElement<LeafletFlowMap<PointDatum, FlowDatum>, HTMLDivElement>, props, props.data)\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 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 VisLeafletFlowMap: (<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLeafletFlowMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;AAsBO,MAAM,6BAA6B,eAAe;AAGzD,SAAS,oBAAgG,OAAsD,MAA+E;AAC5O,QAAM,MAAM,OAAmF,IAAI;AACnG,QAAM,eAAe,OAA0D,MAAS;AAGxF,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,eAAsC,IAAI,SAAuF,OAAO,MAAM,IAAI;AAChK,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;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,oBAA+K,MAAM,KAAK,MAAM,WAAW,mBAAmB,GAAG,aAAa;"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { LeafletMap } from '@unovis/ts/components/leaflet-map';
|
|
3
|
-
import { LeafletMapConfigInterface } from '@unovis/ts/components/leaflet-map/config';
|
|
4
|
-
import { GenericDataRecord } from '@unovis/ts/types/data';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { LeafletMap } from '@unovis/ts/components/leaflet-map';
|
|
3
|
+
import { LeafletMapConfigInterface } from '@unovis/ts/components/leaflet-map/config';
|
|
4
|
+
import { GenericDataRecord } from '@unovis/ts/types/data';
|
|
5
|
+
|
|
6
|
+
export type VisLeafletMapRef<Datum extends GenericDataRecord> = {
|
|
7
|
+
component?: LeafletMap<Datum>;
|
|
8
|
+
};
|
|
9
|
+
export type VisLeafletMapProps<Datum extends GenericDataRecord> = LeafletMapConfigInterface<Datum> & {
|
|
10
|
+
data?: Datum[];
|
|
11
|
+
ref?: Ref<VisLeafletMapRef<Datum>>;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const VisLeafletMapSelectors: typeof import("@unovis/ts/components/leaflet-map/style");
|
|
15
|
+
export declare const VisLeafletMap: (<Datum extends GenericDataRecord>(props: VisLeafletMapProps<Datum>) => JSX.Element | null);
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useImperativeHandle } from
|
|
2
|
-
import { LeafletMap } 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
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
1
|
+
import React, { useRef, useEffect, useImperativeHandle } from "react";
|
|
2
|
+
import { LeafletMap } from "@unovis/ts/components/leaflet-map";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
const VisLeafletMapSelectors = LeafletMap.selectors;
|
|
5
|
+
function VisLeafletMapFC(props, fRef) {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const componentRef = useRef(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
const c = new LeafletMap(ref.current, props, props.data);
|
|
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
|
+
if (props.data) component?.setData(props.data);
|
|
21
|
+
component?.setConfig(props);
|
|
22
|
+
});
|
|
23
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
24
|
+
return componentRef.current;
|
|
25
|
+
} }), []);
|
|
26
|
+
return /* @__PURE__ */ React.createElement("div", { className: props.className, ref });
|
|
27
|
+
}
|
|
28
28
|
const VisLeafletMap = React.memo(React.forwardRef(VisLeafletMapFC), arePropsEqual);
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
export {
|
|
30
|
+
VisLeafletMap,
|
|
31
|
+
VisLeafletMapSelectors
|
|
32
|
+
};
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-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 { LeafletMap } from '@unovis/ts/components/leaflet-map'\nimport { LeafletMapConfigInterface } from '@unovis/ts/components/leaflet-map/config'\nimport { GenericDataRecord } from '@unovis/ts/types/data'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisLeafletMapRef<Datum extends GenericDataRecord> = {\n component?: LeafletMap<Datum>;\n}\n\nexport type VisLeafletMapProps<Datum extends GenericDataRecord> = LeafletMapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLeafletMapRef<Datum>>;\n className?: string;\n}\n\nexport const VisLeafletMapSelectors = LeafletMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLeafletMapFC<Datum extends GenericDataRecord> (props: VisLeafletMapProps<Datum>, fRef: ForwardedRef<VisLeafletMapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<LeafletMap<Datum>, HTMLDivElement>>(null)\n const componentRef = useRef<LeafletMap<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<LeafletMap<Datum>, HTMLDivElement>)\n\n const c = new LeafletMap<Datum>(ref.current as VisComponentElement<LeafletMap<Datum>, HTMLDivElement>, props, props.data)\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 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 VisLeafletMap: (<Datum extends GenericDataRecord>(props: VisLeafletMapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLeafletMapFC), arePropsEqual)\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-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 { LeafletMap } from '@unovis/ts/components/leaflet-map'\nimport { LeafletMapConfigInterface } from '@unovis/ts/components/leaflet-map/config'\nimport { GenericDataRecord } from '@unovis/ts/types/data'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisLeafletMapRef<Datum extends GenericDataRecord> = {\n component?: LeafletMap<Datum>;\n}\n\nexport type VisLeafletMapProps<Datum extends GenericDataRecord> = LeafletMapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLeafletMapRef<Datum>>;\n className?: string;\n}\n\nexport const VisLeafletMapSelectors = LeafletMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLeafletMapFC<Datum extends GenericDataRecord> (props: VisLeafletMapProps<Datum>, fRef: ForwardedRef<VisLeafletMapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<LeafletMap<Datum>, HTMLDivElement>>(null)\n const componentRef = useRef<LeafletMap<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<LeafletMap<Datum>, HTMLDivElement>)\n\n const c = new LeafletMap<Datum>(ref.current as VisComponentElement<LeafletMap<Datum>, HTMLDivElement>, props, props.data)\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 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 VisLeafletMap: (<Datum extends GenericDataRecord>(props: VisLeafletMapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLeafletMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;AAsBO,MAAM,yBAAyB,WAAW;AAGjD,SAAS,gBAAkD,OAAkC,MAA2D;AACtJ,QAAM,MAAM,OAA+D,IAAI;AAC/E,QAAM,eAAe,OAAsC,MAAS;AAGpE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,WAAkB,IAAI,SAAmE,OAAO,MAAM,IAAI;AACxH,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;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,gBAA6G,MAAM,KAAK,MAAM,WAAW,eAAe,GAAG,aAAa;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { RollingPinLegend } from '@unovis/ts/components/rolling-pin-legend';
|
|
3
|
-
import { RollingPinLegendConfigInterface } from '@unovis/ts/components/rolling-pin-legend/config';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { RollingPinLegend } from '@unovis/ts/components/rolling-pin-legend';
|
|
3
|
+
import { RollingPinLegendConfigInterface } from '@unovis/ts/components/rolling-pin-legend/config';
|
|
4
|
+
|
|
5
|
+
export type VisRollingPinLegendRef = {
|
|
6
|
+
component?: RollingPinLegend;
|
|
7
|
+
};
|
|
8
|
+
export type VisRollingPinLegendProps = RollingPinLegendConfigInterface & {
|
|
9
|
+
ref?: Ref<VisRollingPinLegendRef>;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const VisRollingPinLegendSelectors: typeof import("@unovis/ts/components/rolling-pin-legend/style");
|
|
13
|
+
export declare const VisRollingPinLegend: ((props: VisRollingPinLegendProps) => JSX.Element | null);
|