@gemx-dev/heatmap-react 3.5.59 → 3.5.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/VizElement/ElementOverlay.d.ts +1 -0
- package/dist/esm/components/VizElement/ElementOverlay.d.ts.map +1 -1
- package/dist/esm/components/VizElement/HeatmapElements.d.ts +1 -1
- package/dist/esm/components/VizElement/HeatmapElements.d.ts.map +1 -1
- package/dist/esm/components/VizElement/HoveredElementOverlay.d.ts.map +1 -1
- package/dist/esm/components/VizElement/RankBadge.d.ts.map +1 -1
- package/dist/esm/configs/backdrop.d.ts +1 -1
- package/dist/esm/configs/elm-callout.d.ts +6 -0
- package/dist/esm/configs/elm-callout.d.ts.map +1 -0
- package/dist/esm/configs/index.d.ts +2 -0
- package/dist/esm/configs/index.d.ts.map +1 -1
- package/dist/esm/configs/zoom.d.ts +6 -0
- package/dist/esm/configs/zoom.d.ts.map +1 -0
- package/dist/esm/helpers/viewport/element.d.ts +2 -1
- package/dist/esm/helpers/viewport/element.d.ts.map +1 -1
- package/dist/esm/helpers/viz-elm-callout/dimensions.d.ts +3 -2
- package/dist/esm/helpers/viz-elm-callout/dimensions.d.ts.map +1 -1
- package/dist/esm/helpers/viz-elm-callout/position-candidates.d.ts.map +1 -1
- package/dist/esm/helpers/viz-elm-callout/position-selector.d.ts.map +1 -1
- package/dist/esm/helpers/viz-elm-callout/viz-elm.d.ts.map +1 -1
- package/dist/esm/hooks/view-context/useHeatmapViz.d.ts +2 -0
- package/dist/esm/hooks/view-context/useHeatmapViz.d.ts.map +1 -1
- package/dist/esm/hooks/viz-elm/useHeatmapEffects.d.ts.map +1 -1
- package/dist/esm/hooks/viz-elm/useHoveredElement.d.ts.map +1 -1
- package/dist/esm/hooks/viz-scale/useScaleCalculation.d.ts.map +1 -1
- package/dist/esm/index.js +110 -36
- package/dist/esm/index.mjs +110 -36
- package/dist/esm/stores/viz.d.ts +2 -0
- package/dist/esm/stores/viz.d.ts.map +1 -1
- package/dist/esm/types/viz-elm-callout.d.ts +6 -0
- package/dist/esm/types/viz-elm-callout.d.ts.map +1 -1
- package/dist/style.css +8 -3
- package/dist/umd/components/VizElement/ElementOverlay.d.ts +1 -0
- package/dist/umd/components/VizElement/ElementOverlay.d.ts.map +1 -1
- package/dist/umd/components/VizElement/HeatmapElements.d.ts +1 -1
- package/dist/umd/components/VizElement/HeatmapElements.d.ts.map +1 -1
- package/dist/umd/components/VizElement/HoveredElementOverlay.d.ts.map +1 -1
- package/dist/umd/components/VizElement/RankBadge.d.ts.map +1 -1
- package/dist/umd/configs/backdrop.d.ts +1 -1
- package/dist/umd/configs/elm-callout.d.ts +6 -0
- package/dist/umd/configs/elm-callout.d.ts.map +1 -0
- package/dist/umd/configs/index.d.ts +2 -0
- package/dist/umd/configs/index.d.ts.map +1 -1
- package/dist/umd/configs/zoom.d.ts +6 -0
- package/dist/umd/configs/zoom.d.ts.map +1 -0
- package/dist/umd/helpers/viewport/element.d.ts +2 -1
- package/dist/umd/helpers/viewport/element.d.ts.map +1 -1
- package/dist/umd/helpers/viz-elm-callout/dimensions.d.ts +3 -2
- package/dist/umd/helpers/viz-elm-callout/dimensions.d.ts.map +1 -1
- package/dist/umd/helpers/viz-elm-callout/position-candidates.d.ts.map +1 -1
- package/dist/umd/helpers/viz-elm-callout/position-selector.d.ts.map +1 -1
- package/dist/umd/helpers/viz-elm-callout/viz-elm.d.ts.map +1 -1
- package/dist/umd/hooks/view-context/useHeatmapViz.d.ts +2 -0
- package/dist/umd/hooks/view-context/useHeatmapViz.d.ts.map +1 -1
- package/dist/umd/hooks/viz-elm/useHeatmapEffects.d.ts.map +1 -1
- package/dist/umd/hooks/viz-elm/useHoveredElement.d.ts.map +1 -1
- package/dist/umd/hooks/viz-scale/useScaleCalculation.d.ts.map +1 -1
- package/dist/umd/index.js +2 -2
- package/dist/umd/stores/viz.d.ts +2 -0
- package/dist/umd/stores/viz.d.ts.map +1 -1
- package/dist/umd/types/viz-elm-callout.d.ts +6 -0
- package/dist/umd/types/viz-elm-callout.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import type { ElementInfo } from '../../types';
|
|
|
2
2
|
export interface ElementOverlayProps {
|
|
3
3
|
type: 'hovered' | 'clicked';
|
|
4
4
|
element: ElementInfo | null;
|
|
5
|
+
hideOutline?: boolean;
|
|
5
6
|
elementId: string;
|
|
6
7
|
containerRef?: React.RefObject<HTMLDivElement>;
|
|
7
8
|
onClick?: (event?: React.MouseEvent<HTMLDivElement>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/ElementOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU/C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC9D;
|
|
1
|
+
{"version":3,"file":"ElementOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/ElementOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU/C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC9D;AA2DD,eAAO,MAAM,cAAc,2DAAgC,CAAC"}
|
|
@@ -5,7 +5,7 @@ interface HeatmapElementsProps {
|
|
|
5
5
|
visualizer?: WebVisualizer;
|
|
6
6
|
isVisible?: boolean;
|
|
7
7
|
iframeDimensions?: React.CSSProperties;
|
|
8
|
-
|
|
8
|
+
isHideTopRank?: boolean;
|
|
9
9
|
isSecondary?: boolean;
|
|
10
10
|
positionMode?: ICalloutPositionMode;
|
|
11
11
|
iframeRef: React.RefObject<HTMLIFrameElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatmapElements.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/HeatmapElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"HeatmapElements.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/HeatmapElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAe7D,UAAU,oBAAoB;IAC5B,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC9C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAC5C;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgD1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoveredElementOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/HoveredElementOverlay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HoveredElementOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/HoveredElementOverlay.tsx"],"names":[],"mappings":"AAOA,UAAU,0BAA0B;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7E;AA+BD,eAAO,MAAM,qBAAqB,kEAAuC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RankBadge.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/RankBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"RankBadge.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/RankBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/C,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AA0BD,eAAO,MAAM,SAAS,sDAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elm-callout.d.ts","sourceRoot":"","sources":["../../src/configs/elm-callout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../src/configs/zoom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { ElementRect } from '../../types';
|
|
1
|
+
import type { ElementRect, IVisualDomViewport } from '../../types';
|
|
2
2
|
export declare function isElementInViewport(elementRect: ElementRect, visualRef: React.RefObject<HTMLDivElement>, scale: number): boolean;
|
|
3
|
+
export declare function isElementRectInViewport(elementRect: ElementRect, visualRect: IVisualDomViewport, scale: number): boolean;
|
|
3
4
|
//# sourceMappingURL=element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/helpers/viewport/element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/helpers/viewport/element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEnE,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAC1C,KAAK,EAAE,MAAM,GACZ,OAAO,CAqBT;AAED,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,MAAM,GACZ,OAAO,CAuBT"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { IRectDimensions, IViewportDimensions } from '../../types';
|
|
2
|
-
export declare const
|
|
1
|
+
import type { IRectDimensions, IViewportDimensions, IVisualDomViewport } from '../../types';
|
|
2
|
+
export declare const getContainerViewport: (containerElm?: HTMLElement | null, _scale?: number) => IViewportDimensions;
|
|
3
|
+
export declare const getVisualDomViewport: (visualDomElm?: HTMLElement | null, scale?: number) => IVisualDomViewport;
|
|
3
4
|
interface IElementDimensionsOptions {
|
|
4
5
|
targetElm: Element;
|
|
5
6
|
calloutElm: HTMLElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/dimensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/dimensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAI1G,eAAO,MAAM,oBAAoB,GAAI,eAAe,WAAW,GAAG,IAAI,EAAE,SAAS,MAAM,KAAG,mBAYzF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,eAAe,WAAW,GAAG,IAAI,EAAE,cAAS,KAAG,kBAkBnF,CAAC;AAEF,UAAU,yBAAyB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,WAAW,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,WAAW,CAAC;CAC3B;AACD,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,KAAG,eAqCzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position-candidates.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-candidates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAClB,wBAAwB,EAEzB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"position-candidates.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-candidates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAClB,wBAAwB,EAEzB,MAAM,aAAa,CAAC;AAgBrB,eAAO,MAAM,kCAAkC,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EA+BxG,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EAU1G,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EAsB3F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position-selector.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAExG,eAAO,MAAM,kBAAkB,GAAI,YAAY,kBAAkB,EAAE,KAAG,
|
|
1
|
+
{"version":3,"file":"position-selector.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAExG,eAAO,MAAM,kBAAkB,GAAI,YAAY,kBAAkB,EAAE,KAAG,kBAGrE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,WAAW,kBAAkB,EAC7B,SAAS,wBAAwB,KAChC,sBA0BF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viz-elm.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/viz-elm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,yBAAyB,EAK1B,MAAM,aAAa,CAAC;AAkErB,eAAO,MAAM,mBAAmB,GAAI,SAAS,yBAAyB,
|
|
1
|
+
{"version":3,"file":"viz-elm.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/viz-elm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,yBAAyB,EAK1B,MAAM,aAAa,CAAC;AAkErB,eAAO,MAAM,mBAAmB,GAAI,SAAS,yBAAyB,eAkDrE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,OAAO,iCAAiC,SAiEnF,CAAC"}
|
|
@@ -2,6 +2,7 @@ interface IHeatmapVizState {
|
|
|
2
2
|
isRenderViz: boolean;
|
|
3
3
|
zoomRatio: number;
|
|
4
4
|
minZoomRatio: number;
|
|
5
|
+
maxZoomRatio: number;
|
|
5
6
|
widthScale: number;
|
|
6
7
|
isScaledToFit: boolean;
|
|
7
8
|
}
|
|
@@ -9,6 +10,7 @@ interface IHeatmapVizActions {
|
|
|
9
10
|
setIsRenderViz: (value: boolean) => void;
|
|
10
11
|
setZoomRatio: (value: number) => void;
|
|
11
12
|
setMinZoomRatio: (value: number) => void;
|
|
13
|
+
setMaxZoomRatio: (value: number) => void;
|
|
12
14
|
setScale: (value: number) => void;
|
|
13
15
|
setIsScaledToFit: (value: boolean) => void;
|
|
14
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapViz.d.ts","sourceRoot":"","sources":["../../../src/hooks/view-context/useHeatmapViz.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHeatmapViz.d.ts","sourceRoot":"","sources":["../../../src/hooks/view-context/useHeatmapViz.ts"],"names":[],"mappings":"AAUA,UAAU,gBAAgB;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,kBAAkB;IAC1B,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAMtE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa;;;;;;;CAoBxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapEffects.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-elm/useHeatmapEffects.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHeatmapEffects.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-elm/useHeatmapEffects.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,GAAI,eAAe;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,SAqBvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoveredElement.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-elm/useHoveredElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHoveredElement.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-elm/useHoveredElement.ts"],"names":[],"mappings":"AAUA,UAAU,MAAM;IACd,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC9C,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,GAAI,wBAAwB,MAAM;uEA+CpD,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;;0BAwB/B,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,MAAM;CA4B3D,CAAC;AAiBF,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,YAAY,OAAO,EACnB,OAAO,MAAM,KACZ;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAUxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScaleCalculation.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-scale/useScaleCalculation.ts"],"names":[],"mappings":"AAIA,UAAU,yBAAyB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,0BAA0B;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"useScaleCalculation.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-scale/useScaleCalculation.ts"],"names":[],"mappings":"AAIA,UAAU,yBAAyB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,0BAA0B;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,yBAAyB,KAAG,0BA2DtE,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -57,13 +57,19 @@ const BACKDROP_CONFIG = {
|
|
|
57
57
|
* Default cutout expansion (pixels)
|
|
58
58
|
* Adds padding around the active element cutout
|
|
59
59
|
*/
|
|
60
|
-
CUTOUT_EXPANSION:
|
|
60
|
+
CUTOUT_EXPANSION: 0,
|
|
61
61
|
/**
|
|
62
62
|
* Z-index for backdrop canvas
|
|
63
63
|
*/
|
|
64
64
|
Z_INDEX: 999,
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
+
const ELM_CALLOUT_CONFIG = {
|
|
68
|
+
MOUSE_POSITION: true,
|
|
69
|
+
SHOW_RANK_BADGE: false,
|
|
70
|
+
HIDE_OUTLINE_ON_CLICKED: true,
|
|
71
|
+
};
|
|
72
|
+
|
|
67
73
|
// Portal mode: Full permissions for proper functionality
|
|
68
74
|
// Need allow-forms for add to cart, allow-popups for some features
|
|
69
75
|
const HEATMAP_IFRAME = {
|
|
@@ -107,6 +113,12 @@ const Z_INDEX = {
|
|
|
107
113
|
SIDEBAR_POPOVER: 4001,
|
|
108
114
|
};
|
|
109
115
|
|
|
116
|
+
const DEFAULT_ZOOM_RATIO = {
|
|
117
|
+
DEFAULT: 100,
|
|
118
|
+
MIN: 10,
|
|
119
|
+
MAX: 100,
|
|
120
|
+
};
|
|
121
|
+
|
|
110
122
|
/**
|
|
111
123
|
* Creates a debounced version of a callback that delays invoking until after
|
|
112
124
|
* wait milliseconds have elapsed since the last time it was invoked.
|
|
@@ -298,8 +310,9 @@ const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
|
298
310
|
const useHeatmapVizStore = create()(subscribeWithSelector((set) => {
|
|
299
311
|
return {
|
|
300
312
|
isRenderViz: new Map([[DEFAULT_VIEW_ID, false]]),
|
|
301
|
-
zoomRatio: new Map([[DEFAULT_VIEW_ID,
|
|
302
|
-
minZoomRatio: new Map([[DEFAULT_VIEW_ID,
|
|
313
|
+
zoomRatio: new Map([[DEFAULT_VIEW_ID, DEFAULT_ZOOM_RATIO.DEFAULT]]),
|
|
314
|
+
minZoomRatio: new Map([[DEFAULT_VIEW_ID, DEFAULT_ZOOM_RATIO.MIN]]),
|
|
315
|
+
maxZoomRatio: new Map([[DEFAULT_VIEW_ID, DEFAULT_ZOOM_RATIO.MAX]]),
|
|
303
316
|
scale: new Map([[DEFAULT_VIEW_ID, 1]]),
|
|
304
317
|
isScaledToFit: new Map([[DEFAULT_VIEW_ID, false]]),
|
|
305
318
|
setIsRenderViz: (isRenderViz, viewId = DEFAULT_VIEW_ID) => set((prev) => {
|
|
@@ -317,6 +330,11 @@ const useHeatmapVizStore = create()(subscribeWithSelector((set) => {
|
|
|
317
330
|
newMinZoomRatio.set(viewId, minZoomRatio);
|
|
318
331
|
return { minZoomRatio: newMinZoomRatio };
|
|
319
332
|
}),
|
|
333
|
+
setMaxZoomRatio: (maxZoomRatio, viewId = DEFAULT_VIEW_ID) => set((prev) => {
|
|
334
|
+
const newMaxZoomRatio = new Map(prev.maxZoomRatio);
|
|
335
|
+
newMaxZoomRatio.set(viewId, maxZoomRatio);
|
|
336
|
+
return { maxZoomRatio: newMaxZoomRatio };
|
|
337
|
+
}),
|
|
320
338
|
setScale: (scale, viewId = DEFAULT_VIEW_ID) => set((prev) => {
|
|
321
339
|
const newScale = new Map(prev.scale);
|
|
322
340
|
newScale.set(viewId, scale);
|
|
@@ -1144,8 +1162,9 @@ const useHeatmapViz = createViewContextHook({
|
|
|
1144
1162
|
useStore: useHeatmapVizStore,
|
|
1145
1163
|
getState: (store, viewId) => ({
|
|
1146
1164
|
isRenderViz: store.isRenderViz.get(viewId) ?? false,
|
|
1147
|
-
zoomRatio: store.zoomRatio.get(viewId) ??
|
|
1148
|
-
minZoomRatio: store.minZoomRatio.get(viewId) ??
|
|
1165
|
+
zoomRatio: store.zoomRatio.get(viewId) ?? DEFAULT_ZOOM_RATIO.DEFAULT,
|
|
1166
|
+
minZoomRatio: store.minZoomRatio.get(viewId) ?? DEFAULT_ZOOM_RATIO.MIN,
|
|
1167
|
+
maxZoomRatio: store.maxZoomRatio.get(viewId) ?? DEFAULT_ZOOM_RATIO.MAX,
|
|
1149
1168
|
widthScale: store.scale.get(viewId) ?? 1,
|
|
1150
1169
|
isScaledToFit: store.isScaledToFit.get(viewId) ?? false,
|
|
1151
1170
|
}),
|
|
@@ -1153,6 +1172,7 @@ const useHeatmapViz = createViewContextHook({
|
|
|
1153
1172
|
setIsRenderViz: (value) => store.setIsRenderViz(value, viewId),
|
|
1154
1173
|
setZoomRatio: (value) => store.setZoomRatio(value, viewId),
|
|
1155
1174
|
setMinZoomRatio: (value) => store.setMinZoomRatio(value, viewId),
|
|
1175
|
+
setMaxZoomRatio: (value) => store.setMaxZoomRatio(value, viewId),
|
|
1156
1176
|
setScale: (value) => store.setScale(value, viewId),
|
|
1157
1177
|
setIsScaledToFit: (value) => store.setIsScaledToFit(value, viewId),
|
|
1158
1178
|
}),
|
|
@@ -1351,6 +1371,25 @@ function isElementInViewport(elementRect, visualRef, scale) {
|
|
|
1351
1371
|
// Element is visible if it overlaps with the viewport
|
|
1352
1372
|
return elementBottom > viewportTop && elementTop < viewportBottom;
|
|
1353
1373
|
}
|
|
1374
|
+
function isElementRectInViewport(elementRect, visualRect, scale) {
|
|
1375
|
+
if (!elementRect)
|
|
1376
|
+
return false;
|
|
1377
|
+
if (!visualRect)
|
|
1378
|
+
return false;
|
|
1379
|
+
// Element position relative to the document (or container's content)
|
|
1380
|
+
const elementTop = elementRect.top * scale;
|
|
1381
|
+
console.log(`🚀 🐥 ~ isElementRectInViewport ~ scale:`, scale);
|
|
1382
|
+
console.log(`🚀 🐥 ~ isElementRectInViewport ~ elementRect.top:`, elementRect.top);
|
|
1383
|
+
const elementBottom = (elementRect.top + elementRect.height) * scale;
|
|
1384
|
+
// Current scroll position
|
|
1385
|
+
const scrollTop = (visualRect?.scrollTop || 0) - 8;
|
|
1386
|
+
console.log(`🚀 🐥 ~ isElementRectInViewport ~ visualRect?.scrollTop:`, visualRect?.scrollTop);
|
|
1387
|
+
const viewportHeight = visualRect.height;
|
|
1388
|
+
// Visible viewport range in the scrollable content
|
|
1389
|
+
const viewportTop = scrollTop;
|
|
1390
|
+
const viewportBottom = scrollTop + viewportHeight;
|
|
1391
|
+
return elementTop > viewportTop && elementBottom < viewportBottom;
|
|
1392
|
+
}
|
|
1354
1393
|
|
|
1355
1394
|
const CLARITY_HEATMAP_CANVAS_ID = 'clarity-heatmap-canvas';
|
|
1356
1395
|
const HEATMAP_ELEMENT_ATTRIBUTE = 'data-clarity-hashalpha';
|
|
@@ -2241,7 +2280,7 @@ function calculateRankPosition(rect, widthScale) {
|
|
|
2241
2280
|
};
|
|
2242
2281
|
}
|
|
2243
2282
|
|
|
2244
|
-
const
|
|
2283
|
+
const getContainerViewport = (containerElm, _scale) => {
|
|
2245
2284
|
if (containerElm) {
|
|
2246
2285
|
const containerRect = containerElm.getBoundingClientRect();
|
|
2247
2286
|
const width = containerRect.width;
|
|
@@ -2253,6 +2292,23 @@ const getViewportDimensions = (containerElm, _scale) => {
|
|
|
2253
2292
|
height: window.innerHeight,
|
|
2254
2293
|
};
|
|
2255
2294
|
};
|
|
2295
|
+
const getVisualDomViewport = (visualDomElm, scale = 1) => {
|
|
2296
|
+
if (visualDomElm) {
|
|
2297
|
+
const rect = visualDomElm.getBoundingClientRect();
|
|
2298
|
+
return {
|
|
2299
|
+
width: rect.width,
|
|
2300
|
+
height: rect.height,
|
|
2301
|
+
scrollTop: visualDomElm.scrollTop,
|
|
2302
|
+
scrollLeft: visualDomElm.scrollLeft,
|
|
2303
|
+
};
|
|
2304
|
+
}
|
|
2305
|
+
return {
|
|
2306
|
+
width: window.innerWidth,
|
|
2307
|
+
height: window.innerHeight,
|
|
2308
|
+
scrollTop: 0,
|
|
2309
|
+
scrollLeft: 0,
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2256
2312
|
const getElementDimensions = (options) => {
|
|
2257
2313
|
const { targetElm, calloutElm, scale, containerElm } = options;
|
|
2258
2314
|
const targetRect = targetElm.getBoundingClientRect();
|
|
@@ -2429,12 +2485,24 @@ const generateHorizontalPositionCandidates = (options) => {
|
|
|
2429
2485
|
});
|
|
2430
2486
|
};
|
|
2431
2487
|
const generateAllCandidates = (options) => {
|
|
2488
|
+
const { visualViewport, rectDimensions } = options;
|
|
2432
2489
|
const verticalCandidates = generateVerticalPositionCandidates(options);
|
|
2433
2490
|
const horizontalCandidates = generateHorizontalPositionCandidates(options);
|
|
2434
|
-
|
|
2491
|
+
const allCandidates = [...verticalCandidates, ...horizontalCandidates];
|
|
2492
|
+
// Thêm isVisibleInViewport cho mỗi candidate
|
|
2493
|
+
return allCandidates.map((candidate) => ({
|
|
2494
|
+
...candidate,
|
|
2495
|
+
isVisibleInViewport: isElementRectInViewport({
|
|
2496
|
+
top: candidate.top,
|
|
2497
|
+
left: candidate.left,
|
|
2498
|
+
width: rectDimensions.calloutRect.width,
|
|
2499
|
+
height: rectDimensions.calloutRect.height,
|
|
2500
|
+
}, visualViewport || { scrollTop: 0, scrollLeft: 0, width: 0, height: 0 }, options.widthScale),
|
|
2501
|
+
}));
|
|
2435
2502
|
};
|
|
2436
2503
|
|
|
2437
2504
|
const selectBestPosition = (candidates) => {
|
|
2505
|
+
// return candidates.find((p) => p.valid && p.isVisibleInViewport) || candidates[0];
|
|
2438
2506
|
return candidates.find((p) => p.valid) || candidates[0];
|
|
2439
2507
|
};
|
|
2440
2508
|
const constrainToViewport = (candidate, options) => {
|
|
@@ -2519,12 +2587,14 @@ const calcCalloutPosition = (options) => {
|
|
|
2519
2587
|
const containerElm = isAbsolute ? calloutElm.parentElement : visualRef?.current;
|
|
2520
2588
|
if (!containerElm)
|
|
2521
2589
|
return;
|
|
2522
|
-
const viewport =
|
|
2590
|
+
const viewport = getContainerViewport(containerElm);
|
|
2591
|
+
const visualViewport = getVisualDomViewport(visualRef?.current, scale);
|
|
2523
2592
|
const rectDimensions = getElementDimensions({ targetElm, calloutElm, scale, containerElm });
|
|
2524
2593
|
const containerRect = createAdjustedContainerRect({ containerElm, scale, isAbsolute, visualRef });
|
|
2525
2594
|
const options = {
|
|
2526
2595
|
rectDimensions,
|
|
2527
2596
|
viewport,
|
|
2597
|
+
visualViewport,
|
|
2528
2598
|
alignment,
|
|
2529
2599
|
offset,
|
|
2530
2600
|
padding,
|
|
@@ -2578,7 +2648,7 @@ const calcCalloutPositionAbsolute = (props) => {
|
|
|
2578
2648
|
left: element.left,
|
|
2579
2649
|
},
|
|
2580
2650
|
};
|
|
2581
|
-
const viewport =
|
|
2651
|
+
const viewport = getContainerViewport(containerElm);
|
|
2582
2652
|
const options = {
|
|
2583
2653
|
rectDimensions,
|
|
2584
2654
|
viewport,
|
|
@@ -4415,8 +4485,8 @@ const useElementCalloutVisible = ({ visualRef, getRect, positionMode }) => {
|
|
|
4415
4485
|
};
|
|
4416
4486
|
|
|
4417
4487
|
const useHeatmapEffects = ({ isVisible }) => {
|
|
4418
|
-
useHeatmapClick((s) => s.selectedElement);
|
|
4419
|
-
useHeatmapClick((s) => s.setShouldShowCallout);
|
|
4488
|
+
// const selectedElement = useHeatmapClick((s) => s.selectedElement);
|
|
4489
|
+
// const setShouldShowCallout = useHeatmapClick((s) => s.setShouldShowCallout);
|
|
4420
4490
|
const resetAll = () => {
|
|
4421
4491
|
// setShouldShowCallout(false);
|
|
4422
4492
|
};
|
|
@@ -4641,6 +4711,8 @@ const useHoveredElement = ({ iframeRef, getRect }) => {
|
|
|
4641
4711
|
};
|
|
4642
4712
|
};
|
|
4643
4713
|
const getElementMousePosition = (event, widthScale) => {
|
|
4714
|
+
if (!ELM_CALLOUT_CONFIG.MOUSE_POSITION)
|
|
4715
|
+
return;
|
|
4644
4716
|
const containerElm = event.target;
|
|
4645
4717
|
if (!containerElm)
|
|
4646
4718
|
return;
|
|
@@ -6586,13 +6658,12 @@ const useObserveIframeHeight = (props) => {
|
|
|
6586
6658
|
return {};
|
|
6587
6659
|
};
|
|
6588
6660
|
|
|
6589
|
-
// Max zoom ratio constant: 100% = fit to width
|
|
6590
|
-
const MAX_ZOOM_RATIO = 100;
|
|
6591
6661
|
const useScaleCalculation = (props) => {
|
|
6592
6662
|
const widthScale = useHeatmapViz((s) => s.widthScale);
|
|
6593
6663
|
const zoomRatio = useHeatmapViz((s) => s.zoomRatio);
|
|
6594
6664
|
const isScaledToFit = useHeatmapViz((s) => s.isScaledToFit);
|
|
6595
6665
|
const minZoomRatio = useHeatmapViz((s) => s.minZoomRatio);
|
|
6666
|
+
const maxZoomRatio = useHeatmapViz((s) => s.maxZoomRatio);
|
|
6596
6667
|
const setScale = useHeatmapViz((s) => s.setScale);
|
|
6597
6668
|
const setIsScaledToFit = useHeatmapViz((s) => s.setIsScaledToFit);
|
|
6598
6669
|
const setMinZoomRatio = useHeatmapViz((s) => s.setMinZoomRatio);
|
|
@@ -6614,9 +6685,9 @@ const useScaleCalculation = (props) => {
|
|
|
6614
6685
|
const calculatedMinZoomRatio = (availableHeight / (contentHeight * widthScale)) * 100;
|
|
6615
6686
|
// Limit minZoomRatio: cannot exceed MAX_ZOOM_RATIO (100%)
|
|
6616
6687
|
// and should have a reasonable minimum (e.g., 1%)
|
|
6617
|
-
const finalMinZoomRatio = Math.max(1, Math.min(calculatedMinZoomRatio,
|
|
6688
|
+
const finalMinZoomRatio = Math.max(1, Math.min(calculatedMinZoomRatio, maxZoomRatio));
|
|
6618
6689
|
// 4. Apply zoom ratio (clamp between min and max)
|
|
6619
|
-
const clampedZoomRatio = Math.max(finalMinZoomRatio, Math.min(zoomRatio,
|
|
6690
|
+
const clampedZoomRatio = Math.max(finalMinZoomRatio, Math.min(zoomRatio, maxZoomRatio));
|
|
6620
6691
|
const zoomMultiplier = clampedZoomRatio / 100;
|
|
6621
6692
|
// 5. Calculate finalScale
|
|
6622
6693
|
// finalScale = widthScale * zoomMultiplier
|
|
@@ -6630,7 +6701,7 @@ const useScaleCalculation = (props) => {
|
|
|
6630
6701
|
setIsScaledToFit(isCurrentlyFitted);
|
|
6631
6702
|
setMinZoomRatio(finalMinZoomRatio);
|
|
6632
6703
|
}
|
|
6633
|
-
}, [containerWidth, containerHeight, contentWidth, contentHeight, zoomRatio]);
|
|
6704
|
+
}, [containerWidth, containerHeight, contentWidth, contentHeight, zoomRatio, maxZoomRatio]);
|
|
6634
6705
|
useEffect(() => {
|
|
6635
6706
|
calculateScaleResult();
|
|
6636
6707
|
}, [calculateScaleResult]);
|
|
@@ -7765,7 +7836,7 @@ VizAreaClick.displayName = 'VizAreaClick';
|
|
|
7765
7836
|
const RankBadgeComponent = ({ index, hash, elementRect, widthScale, show = true, clickOnElement, }) => {
|
|
7766
7837
|
const clickedHash = useHeatmapClick((s) => s.selectedElement?.hash);
|
|
7767
7838
|
const isShow = !!show && clickedHash !== hash;
|
|
7768
|
-
if (!isShow)
|
|
7839
|
+
if (!isShow || !ELM_CALLOUT_CONFIG.SHOW_RANK_BADGE)
|
|
7769
7840
|
return null;
|
|
7770
7841
|
const style = calculateRankPosition(elementRect, widthScale);
|
|
7771
7842
|
return (jsx("div", { className: "gx-hm-rank-badge", style: style, onClick: clickOnElement, children: index }));
|
|
@@ -7839,10 +7910,17 @@ const useAnchorPosition = (calloutRef, props) => {
|
|
|
7839
7910
|
const calloutElm = calloutRef.current;
|
|
7840
7911
|
if (!targetElm || !calloutElm)
|
|
7841
7912
|
return;
|
|
7913
|
+
const onSetPosition = (position) => {
|
|
7914
|
+
setPosition((prev) => {
|
|
7915
|
+
if (prev.top === position.top && prev.left === position.left)
|
|
7916
|
+
return prev;
|
|
7917
|
+
return position;
|
|
7918
|
+
});
|
|
7919
|
+
};
|
|
7842
7920
|
const positionFn = calcCalloutPosition({
|
|
7843
7921
|
targetElm,
|
|
7844
7922
|
calloutElm,
|
|
7845
|
-
setPosition,
|
|
7923
|
+
setPosition: onSetPosition,
|
|
7846
7924
|
alignment,
|
|
7847
7925
|
positionMode,
|
|
7848
7926
|
visualRef,
|
|
@@ -8025,7 +8103,7 @@ const ElementCalloutOverlay = (props) => {
|
|
|
8025
8103
|
ElementCalloutOverlay.displayName = 'ElementCalloutOverlay';
|
|
8026
8104
|
|
|
8027
8105
|
const ElementOverlayComponent = (props) => {
|
|
8028
|
-
const { type, element, onClick, elementId } = props;
|
|
8106
|
+
const { type, element, onClick, elementId, hideOutline } = props;
|
|
8029
8107
|
const widthScale = useHeatmapViz((s) => s.widthScale);
|
|
8030
8108
|
const viewportHeight = useHeatmapVizRect((s) => s.iframeHeight);
|
|
8031
8109
|
const viewportWidth = useHeatmapConfigStore((s) => s.width);
|
|
@@ -8045,7 +8123,7 @@ const ElementOverlayComponent = (props) => {
|
|
|
8045
8123
|
const isHovered = type === 'hovered';
|
|
8046
8124
|
const badgeWidthScale = isHovered ? 1 : widthScale;
|
|
8047
8125
|
const showCallout = !!element?.mousePosition && !isHovered;
|
|
8048
|
-
return (jsxs(Fragment$1, { children: [jsx("div", { onClick: onClick, className: `heatmapElement heatmapElement--${type}`, id: elementId, style: overlayStyle, children: showCallout && jsx(ElementCalloutOverlay, { ...props }) }), jsx(BackdropCanvas, { activeElement: overlayStyle, viewportWidth: viewportWidth, viewportHeight: viewportHeight, show: !isHovered }), jsx(RankBadge, { hash: element.hash, show: isHovered, index: element.rank, elementRect: element, widthScale: badgeWidthScale, clickOnElement: onClick })] }));
|
|
8126
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { onClick: onClick, className: `heatmapElement heatmapElement--${type} ${hideOutline ? 'heatmapElement--hide-outline' : ''}`, id: elementId, style: overlayStyle, children: showCallout && jsx(ElementCalloutOverlay, { ...props }) }), jsx(BackdropCanvas, { activeElement: overlayStyle, viewportWidth: viewportWidth, viewportHeight: viewportHeight, show: !isHovered }), jsx(RankBadge, { hash: element.hash, show: isHovered, index: element.rank, elementRect: element, widthScale: badgeWidthScale, clickOnElement: onClick })] }));
|
|
8049
8127
|
};
|
|
8050
8128
|
ElementOverlayComponent.displayName = 'ElementOverlay';
|
|
8051
8129
|
const ElementOverlay = memo(ElementOverlayComponent);
|
|
@@ -8069,6 +8147,7 @@ const ElementCalloutClicked = memo(ElementCalloutClickedComponent);
|
|
|
8069
8147
|
const HoveredElementOverlayComponent = ({ onClick }) => {
|
|
8070
8148
|
const viewId = useViewIdContext();
|
|
8071
8149
|
const hoveredElement = useHeatmapHover((s) => s.hoveredElement);
|
|
8150
|
+
const clickedElement = useHeatmapClick((s) => s.selectedElement);
|
|
8072
8151
|
const handleClick = (event) => {
|
|
8073
8152
|
if (onClick) {
|
|
8074
8153
|
onClick(event, hoveredElement?.hash ?? '');
|
|
@@ -8077,7 +8156,8 @@ const HoveredElementOverlayComponent = ({ onClick }) => {
|
|
|
8077
8156
|
if (!hoveredElement)
|
|
8078
8157
|
return null;
|
|
8079
8158
|
const elementId = getHoveredElementId(viewId, false);
|
|
8080
|
-
|
|
8159
|
+
const hideOutline = clickedElement?.hash === hoveredElement?.hash && ELM_CALLOUT_CONFIG.HIDE_OUTLINE_ON_CLICKED;
|
|
8160
|
+
return (jsx(Fragment$1, { children: jsx(ElementOverlay, { type: "hovered", element: hoveredElement, elementId: elementId, onClick: handleClick, hideOutline: hideOutline }) }));
|
|
8081
8161
|
};
|
|
8082
8162
|
const HoveredElementOverlay = memo(HoveredElementOverlayComponent);
|
|
8083
8163
|
|
|
@@ -8095,22 +8175,16 @@ const HeatmapElements = (props) => {
|
|
|
8095
8175
|
const viewId = useViewIdContext();
|
|
8096
8176
|
const iframeHeight = useHeatmapVizRect((s) => s.iframeHeight);
|
|
8097
8177
|
const elementCalloutRef = useRef(null);
|
|
8098
|
-
const { iframeDimensions,
|
|
8099
|
-
const {
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
});
|
|
8104
|
-
const { handleMouseMove, handleMouseLeave, handleClick } = useHoveredElement({
|
|
8105
|
-
iframeRef: props.iframeRef,
|
|
8106
|
-
getRect,
|
|
8107
|
-
});
|
|
8108
|
-
useElementCalloutVisible({ visualRef: props.visualRef, getRect, positionMode });
|
|
8178
|
+
const { iframeDimensions, positionMode } = props;
|
|
8179
|
+
const { visualRef, iframeRef, wrapperRef, visualizer } = props;
|
|
8180
|
+
const { isVisible = true, isSecondary, isHideTopRank } = props;
|
|
8181
|
+
const { getRect } = useHeatmapElementPosition({ iframeRef, wrapperRef, visualizer });
|
|
8182
|
+
const { handleMouseMove, handleMouseLeave, handleClick } = useHoveredElement({ iframeRef, getRect });
|
|
8183
|
+
useElementCalloutVisible({ visualRef, getRect, positionMode });
|
|
8109
8184
|
useHeatmapEffects({ isVisible });
|
|
8110
|
-
useRenderCount('HeatmapElements');
|
|
8111
8185
|
if (!isVisible)
|
|
8112
8186
|
return null;
|
|
8113
|
-
return (jsxs("div", { id: `gx-hm-elements-${viewId}`, ref: elementCalloutRef, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, className: "gx-hm-elements", style: { ...iframeDimensions, height: `${iframeHeight}px` }, children: [jsx(DefaultRankBadges, { getRect: getRect, hidden:
|
|
8187
|
+
return (jsxs("div", { id: `gx-hm-elements-${viewId}`, ref: elementCalloutRef, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, className: "gx-hm-elements", style: { ...iframeDimensions, height: `${iframeHeight}px` }, children: [jsx(DefaultRankBadges, { getRect: getRect, hidden: isHideTopRank }), jsx(ElementCalloutClicked, { visualRef: visualRef, positionMode: positionMode, getRect: getRect, isSecondary: isSecondary, containerRef: elementCalloutRef }), jsx(ElementCalloutHovered, { visualRef: visualRef, onClick: handleClick, isSecondary: isSecondary, positionMode: positionMode })] }));
|
|
8114
8188
|
};
|
|
8115
8189
|
|
|
8116
8190
|
const VizElements = ({ iframeRef, visualRef, wrapperRef }) => {
|
|
@@ -8127,7 +8201,7 @@ const VizElements = ({ iframeRef, visualRef, wrapperRef }) => {
|
|
|
8127
8201
|
// useRenderCount('VizElements');
|
|
8128
8202
|
if (!iframeRef.current)
|
|
8129
8203
|
return null;
|
|
8130
|
-
return (jsx(HeatmapElements, { visualizer: visualizer, visualRef: visualRef, iframeRef: iframeRef, wrapperRef: wrapperRef, heatmapInfo: dataInfo, isVisible: true, positionMode: DEFAULT_POSITION_MODE,
|
|
8204
|
+
return (jsx(HeatmapElements, { visualizer: visualizer, visualRef: visualRef, iframeRef: iframeRef, wrapperRef: wrapperRef, heatmapInfo: dataInfo, isVisible: true, positionMode: DEFAULT_POSITION_MODE, isHideTopRank: true, iframeDimensions: {
|
|
8131
8205
|
width: contentWidth,
|
|
8132
8206
|
position: 'absolute',
|
|
8133
8207
|
top: 0,
|
|
@@ -8572,4 +8646,4 @@ const HeatmapLayout = ({ data, clickmap, clickAreas, scrollmap, controls, dataIn
|
|
|
8572
8646
|
}
|
|
8573
8647
|
};
|
|
8574
8648
|
|
|
8575
|
-
export { BACKDROP_CONFIG, DEFAULT_SIDEBAR_WIDTH, DEFAULT_VIEW_ID, GraphView, HEATMAP_CONFIG, HEATMAP_IFRAME, HEATMAP_STYLE, HeatmapLayout, IClickMode, IClickType, IHeatmapType, IScrollType, ViewIdContext, Z_INDEX, compareViewPerformance, convertViewportToIframeCoords, createStorePerformanceTracker, downloadPerformanceReport, getCompareViewId, getMetricsByViewId, getPerformanceReportJSON, getScrollGradientColor, performanceLogger, printPerformanceSummary, scrollToElementIfNeeded, sendPerformanceReport, serializeAreas, trackStoreAction, useAreaCreation, useAreaEditMode, useAreaFilterVisible, useAreaHydration, useAreaInteraction, useAreaPositionsUpdater, useAreaRectSync, useAreaRendererContainer, useAreaTopAutoDetect, useClickedElement, useDebounceCallback, useElementCalloutVisible, useHeatmapAreaClick, useHeatmapCanvas, useHeatmapClick, useHeatmapCompareStore, useHeatmapConfigStore, useHeatmapCopyView, useHeatmapData, useHeatmapEffects, useHeatmapElementPosition, useHeatmapHover, useHeatmapLiveStore, useHeatmapRenderByMode, useHeatmapScale, useHeatmapScroll, useHeatmapViz, useHeatmapVizRect, useHoveredElement, useIframeHeight, useIframeHeightProcessor, useMeasureFunction, useRegisterConfig, useRegisterControl, useRegisterData, useRegisterHeatmap, useRenderCount, useScrollmapZones, useTrackHookCall, useViewIdContext, useVizLiveRender, useWhyDidYouUpdate, useWrapperRefHeight, useZonePositions, withPerformanceTracking };
|
|
8649
|
+
export { BACKDROP_CONFIG, DEFAULT_SIDEBAR_WIDTH, DEFAULT_VIEW_ID, DEFAULT_ZOOM_RATIO, ELM_CALLOUT_CONFIG, GraphView, HEATMAP_CONFIG, HEATMAP_IFRAME, HEATMAP_STYLE, HeatmapLayout, IClickMode, IClickType, IHeatmapType, IScrollType, ViewIdContext, Z_INDEX, compareViewPerformance, convertViewportToIframeCoords, createStorePerformanceTracker, downloadPerformanceReport, getCompareViewId, getMetricsByViewId, getPerformanceReportJSON, getScrollGradientColor, performanceLogger, printPerformanceSummary, scrollToElementIfNeeded, sendPerformanceReport, serializeAreas, trackStoreAction, useAreaCreation, useAreaEditMode, useAreaFilterVisible, useAreaHydration, useAreaInteraction, useAreaPositionsUpdater, useAreaRectSync, useAreaRendererContainer, useAreaTopAutoDetect, useClickedElement, useDebounceCallback, useElementCalloutVisible, useHeatmapAreaClick, useHeatmapCanvas, useHeatmapClick, useHeatmapCompareStore, useHeatmapConfigStore, useHeatmapCopyView, useHeatmapData, useHeatmapEffects, useHeatmapElementPosition, useHeatmapHover, useHeatmapLiveStore, useHeatmapRenderByMode, useHeatmapScale, useHeatmapScroll, useHeatmapViz, useHeatmapVizRect, useHoveredElement, useIframeHeight, useIframeHeightProcessor, useMeasureFunction, useRegisterConfig, useRegisterControl, useRegisterData, useRegisterHeatmap, useRenderCount, useScrollmapZones, useTrackHookCall, useViewIdContext, useVizLiveRender, useWhyDidYouUpdate, useWrapperRefHeight, useZonePositions, withPerformanceTracking };
|