@cratis/components 0.1.17 → 0.1.19
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 +83 -0
- package/dist/cjs/Common/ErrorBoundary.js +26 -0
- package/dist/cjs/Common/ErrorBoundary.js.map +1 -0
- package/dist/cjs/Common/FormElement.js +10 -0
- package/dist/cjs/Common/FormElement.js.map +1 -0
- package/dist/cjs/Common/index.js +12 -0
- package/dist/cjs/Common/index.js.map +1 -0
- package/dist/cjs/EventModeling/EventModeling.css +146 -0
- package/dist/cjs/EventModeling/EventModeling.js +209 -0
- package/dist/cjs/EventModeling/EventModeling.js.map +1 -0
- package/dist/cjs/EventModeling/components/Canvas.js +403 -0
- package/dist/cjs/EventModeling/components/Canvas.js.map +1 -0
- package/dist/cjs/EventModeling/components/CanvasControls.js +10 -0
- package/dist/cjs/EventModeling/components/CanvasControls.js.map +1 -0
- package/dist/cjs/EventModeling/components/Toolbox.js +18 -0
- package/dist/cjs/EventModeling/components/Toolbox.js.map +1 -0
- package/dist/cjs/EventModeling/engine/connectorGraphics.js +173 -0
- package/dist/cjs/EventModeling/engine/connectorGraphics.js.map +1 -0
- package/dist/cjs/EventModeling/engine/elementSprites.js +301 -0
- package/dist/cjs/EventModeling/engine/elementSprites.js.map +1 -0
- package/dist/cjs/EventModeling/index.js +12 -0
- package/dist/cjs/EventModeling/index.js.map +1 -0
- package/dist/cjs/EventModeling/types.js +60 -0
- package/dist/cjs/EventModeling/types.js.map +1 -0
- package/dist/cjs/PivotViewer/PivotViewer.css +54 -5
- package/dist/cjs/PivotViewer/PivotViewer.js +5 -2
- package/dist/cjs/PivotViewer/PivotViewer.js.map +1 -1
- package/dist/cjs/PivotViewer/components/AxisLabels.js +5 -8
- package/dist/cjs/PivotViewer/components/AxisLabels.js.map +1 -1
- package/dist/cjs/PivotViewer/components/DetailPanel.js +9 -2
- package/dist/cjs/PivotViewer/components/DetailPanel.js.map +1 -1
- package/dist/cjs/PivotViewer/components/PivotCanvas.js +30 -6
- package/dist/cjs/PivotViewer/components/PivotCanvas.js.map +1 -1
- package/dist/cjs/PivotViewer/components/PivotViewerMain.js +16 -5
- package/dist/cjs/PivotViewer/components/PivotViewerMain.js.map +1 -1
- package/dist/cjs/PivotViewer/components/Toolbar.js +34 -2
- package/dist/cjs/PivotViewer/components/Toolbar.js.map +1 -1
- package/dist/cjs/PivotViewer/components/pivot/constants.js +5 -5
- package/dist/cjs/PivotViewer/components/pivot/constants.js.map +1 -1
- package/dist/cjs/PivotViewer/components/pivot/groups.js +15 -15
- package/dist/cjs/PivotViewer/components/pivot/groups.js.map +1 -1
- package/dist/cjs/PivotViewer/components/pivot/sprites.js +10 -27
- package/dist/cjs/PivotViewer/components/pivot/sprites.js.map +1 -1
- package/dist/cjs/PivotViewer/components/pivot/visibility.js +8 -20
- package/dist/cjs/PivotViewer/components/pivot/visibility.js.map +1 -1
- package/dist/cjs/PivotViewer/constants.js +0 -2
- package/dist/cjs/PivotViewer/constants.js.map +1 -1
- package/dist/cjs/PivotViewer/engine/layout.js +1 -1
- package/dist/cjs/PivotViewer/engine/layout.js.map +1 -1
- package/dist/cjs/PivotViewer/hooks/useCardSelection.js +2 -1
- package/dist/cjs/PivotViewer/hooks/useCardSelection.js.map +1 -1
- package/dist/cjs/PivotViewer/hooks/useZoomState.js +4 -0
- package/dist/cjs/PivotViewer/hooks/useZoomState.js.map +1 -1
- package/dist/cjs/PivotViewer/types.js.map +1 -1
- package/dist/cjs/PivotViewer/utils/animations.js +1 -1
- package/dist/cjs/PivotViewer/utils/animations.js.map +1 -1
- package/dist/cjs/PivotViewer/utils/constants.js +1 -1
- package/dist/cjs/PivotViewer/utils/constants.js.map +1 -1
- package/dist/cjs/PivotViewer/utils/selection.js +8 -1
- package/dist/cjs/PivotViewer/utils/selection.js.map +1 -1
- package/dist/cjs/TimeMachine/TimeMachine.js +0 -3
- package/dist/cjs/TimeMachine/TimeMachine.js.map +1 -1
- package/dist/cjs/index.js +16 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +3 -0
- package/dist/esm/Common/ErrorBoundary.js +7 -4
- package/dist/esm/Common/ErrorBoundary.js.map +1 -1
- package/dist/esm/Common/FormElement.js +7 -4
- package/dist/esm/Common/FormElement.js.map +1 -1
- package/dist/esm/Common/index.js +4 -4
- package/dist/esm/Common/index.js.map +1 -1
- package/dist/esm/EventModeling/EventModeling.css +146 -0
- package/dist/esm/EventModeling/EventModeling.d.ts +11 -0
- package/dist/esm/EventModeling/EventModeling.d.ts.map +1 -0
- package/dist/esm/EventModeling/EventModeling.js +207 -0
- package/dist/esm/EventModeling/EventModeling.js.map +1 -0
- package/dist/esm/EventModeling/EventModeling.stories.d.ts +10 -0
- package/dist/esm/EventModeling/EventModeling.stories.d.ts.map +1 -0
- package/dist/esm/EventModeling/EventModeling.stories.js +252 -0
- package/dist/esm/EventModeling/EventModeling.stories.js.map +1 -0
- package/dist/esm/EventModeling/components/Canvas.d.ts +23 -0
- package/dist/esm/EventModeling/components/Canvas.d.ts.map +1 -0
- package/dist/esm/EventModeling/components/Canvas.js +382 -0
- package/dist/esm/EventModeling/components/Canvas.js.map +1 -0
- package/dist/esm/EventModeling/components/CanvasControls.d.ts +10 -0
- package/dist/esm/EventModeling/components/CanvasControls.d.ts.map +1 -0
- package/dist/esm/EventModeling/components/CanvasControls.js +8 -0
- package/dist/esm/EventModeling/components/CanvasControls.js.map +1 -0
- package/dist/esm/EventModeling/components/Toolbox.d.ts +9 -0
- package/dist/esm/EventModeling/components/Toolbox.d.ts.map +1 -0
- package/dist/esm/EventModeling/components/Toolbox.js +16 -0
- package/dist/esm/EventModeling/components/Toolbox.js.map +1 -0
- package/dist/esm/EventModeling/engine/connectorGraphics.d.ts +12 -0
- package/dist/esm/EventModeling/engine/connectorGraphics.d.ts.map +1 -0
- package/dist/esm/EventModeling/engine/connectorGraphics.js +151 -0
- package/dist/esm/EventModeling/engine/connectorGraphics.js.map +1 -0
- package/dist/esm/EventModeling/engine/elementSprites.d.ts +23 -0
- package/dist/esm/EventModeling/engine/elementSprites.d.ts.map +1 -0
- package/dist/esm/EventModeling/engine/elementSprites.js +276 -0
- package/dist/esm/EventModeling/engine/elementSprites.js.map +1 -0
- package/dist/esm/EventModeling/index.d.ts +3 -0
- package/dist/esm/EventModeling/index.d.ts.map +1 -0
- package/dist/esm/EventModeling/index.js +3 -0
- package/dist/esm/EventModeling/index.js.map +1 -0
- package/dist/esm/EventModeling/types.d.ts +79 -0
- package/dist/esm/EventModeling/types.d.ts.map +1 -0
- package/dist/esm/EventModeling/types.js +56 -0
- package/dist/esm/EventModeling/types.js.map +1 -0
- package/dist/esm/PivotViewer/PivotViewer.css +54 -5
- package/dist/esm/PivotViewer/PivotViewer.d.ts.map +1 -1
- package/dist/esm/PivotViewer/PivotViewer.js +5 -2
- package/dist/esm/PivotViewer/PivotViewer.js.map +1 -1
- package/dist/esm/PivotViewer/PivotViewer.stories.d.ts +0 -1
- package/dist/esm/PivotViewer/PivotViewer.stories.d.ts.map +1 -1
- package/dist/esm/PivotViewer/PivotViewer.stories.js +10 -9
- package/dist/esm/PivotViewer/PivotViewer.stories.js.map +1 -1
- package/dist/esm/PivotViewer/components/AxisLabels.d.ts +2 -1
- package/dist/esm/PivotViewer/components/AxisLabels.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/AxisLabels.js +6 -9
- package/dist/esm/PivotViewer/components/AxisLabels.js.map +1 -1
- package/dist/esm/PivotViewer/components/DetailPanel.d.ts +3 -1
- package/dist/esm/PivotViewer/components/DetailPanel.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/DetailPanel.js +10 -3
- package/dist/esm/PivotViewer/components/DetailPanel.js.map +1 -1
- package/dist/esm/PivotViewer/components/PivotCanvas.d.ts +5 -2
- package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/PivotCanvas.js +30 -6
- package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
- package/dist/esm/PivotViewer/components/PivotViewerMain.d.ts +5 -1
- package/dist/esm/PivotViewer/components/PivotViewerMain.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/PivotViewerMain.js +16 -5
- package/dist/esm/PivotViewer/components/PivotViewerMain.js.map +1 -1
- package/dist/esm/PivotViewer/components/Toolbar.d.ts +3 -1
- package/dist/esm/PivotViewer/components/Toolbar.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/Toolbar.js +34 -2
- package/dist/esm/PivotViewer/components/Toolbar.js.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/constants.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/constants.js +5 -5
- package/dist/esm/PivotViewer/components/pivot/constants.js.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/groups.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/groups.js +2 -2
- package/dist/esm/PivotViewer/components/pivot/groups.js.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/sprites.d.ts +10 -2
- package/dist/esm/PivotViewer/components/pivot/sprites.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/sprites.js +10 -27
- package/dist/esm/PivotViewer/components/pivot/sprites.js.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/visibility.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/visibility.js +8 -20
- package/dist/esm/PivotViewer/components/pivot/visibility.js.map +1 -1
- package/dist/esm/PivotViewer/constants.js +1 -2
- package/dist/esm/PivotViewer/constants.js.map +1 -1
- package/dist/esm/PivotViewer/engine/layout.js +1 -1
- package/dist/esm/PivotViewer/engine/layout.js.map +1 -1
- package/dist/esm/PivotViewer/hooks/useCardSelection.d.ts.map +1 -1
- package/dist/esm/PivotViewer/hooks/useCardSelection.js +2 -1
- package/dist/esm/PivotViewer/hooks/useCardSelection.js.map +1 -1
- package/dist/esm/PivotViewer/hooks/useZoomState.d.ts +1 -0
- package/dist/esm/PivotViewer/hooks/useZoomState.d.ts.map +1 -1
- package/dist/esm/PivotViewer/hooks/useZoomState.js +4 -0
- package/dist/esm/PivotViewer/hooks/useZoomState.js.map +1 -1
- package/dist/esm/PivotViewer/types.d.ts +5 -1
- package/dist/esm/PivotViewer/types.d.ts.map +1 -1
- package/dist/esm/PivotViewer/types.js.map +1 -1
- package/dist/esm/PivotViewer/utils/animations.js +1 -1
- package/dist/esm/PivotViewer/utils/animations.js.map +1 -1
- package/dist/esm/PivotViewer/utils/constants.d.ts +1 -1
- package/dist/esm/PivotViewer/utils/constants.d.ts.map +1 -1
- package/dist/esm/PivotViewer/utils/constants.js +1 -1
- package/dist/esm/PivotViewer/utils/constants.js.map +1 -1
- package/dist/esm/PivotViewer/utils/selection.d.ts.map +1 -1
- package/dist/esm/PivotViewer/utils/selection.js +8 -1
- package/dist/esm/PivotViewer/utils/selection.js.map +1 -1
- package/dist/esm/TimeMachine/TimeMachine.js +1 -1
- package/dist/esm/index.d.ts +5 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +16 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +3 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -78
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sources":["../../../../PivotViewer/components/Toolbar.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { PivotDimension } from '../types';\nimport { ZOOM_MIN, ZOOM_MAX, ZOOM_STEP } from '../utils/utils';\n\nexport type ViewMode = 'collection' | 'grouped';\n\nexport interface ToolbarProps<TItem extends object> {\n hasFilters: boolean;\n filtersOpen: boolean;\n filteredCount: number;\n viewMode: ViewMode;\n zoomLevel: number;\n activeDimensionKey: string;\n dimensions: PivotDimension<TItem>[];\n activeFilterCount: number;\n onFiltersToggle: () => void;\n onViewModeChange: (mode: ViewMode) => void;\n onZoomIn: () => void;\n onZoomOut: () => void;\n onZoomSlider: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onDimensionChange: (key: string) => void;\n filterButtonRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nexport function Toolbar<TItem extends object>({\n hasFilters,\n filtersOpen,\n filteredCount,\n viewMode,\n zoomLevel,\n activeDimensionKey,\n dimensions,\n activeFilterCount,\n onFiltersToggle,\n onViewModeChange,\n onZoomIn,\n onZoomOut,\n onZoomSlider,\n onDimensionChange,\n filterButtonRef,\n}: ToolbarProps<TItem>) {\n const labelText = 'Sort by';\n\n return (\n <header className=\"pv-toolbar\">\n <div className=\"pv-toolbar-left\">\n {hasFilters && (\n <button\n ref={filterButtonRef}\n type=\"button\"\n className={`pv-filter-icon-button ${filtersOpen ? 'active' : ''}`}\n onClick={onFiltersToggle}\n title=\"Filters\"\n >\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polygon points=\"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3\" />\n </svg>\n {activeFilterCount > 0 && (\n <span className=\"pv-filter-badge\">{activeFilterCount}</span>\n )}\n </button>\n )}\n <h1>Pivot Viewer</h1>\n <span className=\"pv-count\">{filteredCount} events</span>\n </div>\n <div className=\"pv-toolbar-right\">\n <div className=\"pv-zoom-controls\">\n <button\n type=\"button\"\n onClick={onZoomOut}\n disabled={zoomLevel <= ZOOM_MIN}\n title=\"Zoom out\"\n >\n −\n </button>\n <input\n type=\"range\"\n className=\"pv-zoom-slider\"\n min={ZOOM_MIN}\n max={ZOOM_MAX}\n step={ZOOM_STEP}\n value={zoomLevel}\n onChange={onZoomSlider}\n title={`Zoom: ${Math.round(zoomLevel * 100)}%`}\n />\n <span className=\"pv-zoom-level\">{Math.round(zoomLevel * 100)}%</span>\n <button\n type=\"button\"\n onClick={onZoomIn}\n disabled={zoomLevel >= ZOOM_MAX}\n title=\"Zoom in\"\n >\n +\n </button>\n </div>\n <div className=\"pv-view-toggle\">\n <button\n type=\"button\"\n className={viewMode === 'collection' ? 'active' : ''}\n onClick={() => onViewModeChange('collection')}\n >\n Collection\n </button>\n <button\n type=\"button\"\n className={viewMode === 'grouped' ? 'active' : ''}\n onClick={() => onViewModeChange('grouped')}\n >\n Grouped\n </button>\n </div>\n <label className=\"pv-dimension-select\">\n <span>{labelText}</span>\n <select\n value={activeDimensionKey}\n onChange={(event) => onDimensionChange(event.target.value)}\n >\n {dimensions.map((dimension) => (\n <option key={dimension.key} value={dimension.key}>\n {dimension.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n </header>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;AA0BM,SAAU,OAAO,CAAuB,EAC5C,UAAU,EACV,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,eAAe,GACK,EAAA;IACpB,MAAM,SAAS,GAAG,SAAS;AAE3B,IAAA,QACEA,IAAA,CAAA,QAAA,EAAA,EAAQ,SAAS,EAAC,YAAY,EAAA,QAAA,EAAA,CAC5BA,cAAK,SAAS,EAAC,iBAAiB,EAAA,QAAA,EAAA,CAC7B,UAAU,KACTA,iBACE,GAAG,EAAE,eAAe,EACpB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,yBAAyB,WAAW,GAAG,QAAQ,GAAG,EAAE,CAAA,CAAE,EACjE,OAAO,EAAE,eAAe,EACxB,KAAK,EAAC,SAAS,aAEfC,GAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,YAC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,SAAS,IAAI,QAAQ,EAC/B,KAAK,EAAC,SAAS,EAAA,QAAA,EAAA,GAAA,EAAA,CAGR,CAAA,EAAA,CACL,EACND,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,gBAAgB,EAAA,QAAA,EAAA,CAC7BC,gBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,QAAQ,KAAK,YAAY,GAAG,QAAQ,GAAG,EAAE,EACpD,OAAO,EAAE,MAAM,gBAAgB,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,YAAA,EAAA,CAGtC,EACTA,gBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,QAAQ,KAAK,SAAS,GAAG,QAAQ,GAAG,EAAE,EACjD,OAAO,EAAE,MAAM,gBAAgB,CAAC,SAAS,CAAC,EAAA,QAAA,EAAA,SAAA,EAAA,CAGnC,CAAA,EAAA,CACL,EACND,IAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAC,qBAAqB,EAAA,QAAA,EAAA,CACpCC,wBAAO,SAAS,EAAA,CAAQ,EACxBA,GAAA,CAAA,QAAA,EAAA,EACE,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,CAAC,KAAK,KAAK,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAA,QAAA,EAEzD,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,MACxBA,GAAA,CAAA,QAAA,EAAA,EAA4B,KAAK,EAAE,SAAS,CAAC,GAAG,YAC7C,SAAS,CAAC,KAAK,EAAA,EADL,SAAS,CAAC,GAAG,CAEjB,CACV,CAAC,EAAA,CACK,IACH,CAAA,EAAA,CACJ,CAAA,EAAA,CACC;AAEb;;;;"}
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sources":["../../../../PivotViewer/components/Toolbar.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport type { PivotDimension } from '../types';\nimport { ZOOM_MIN, ZOOM_MAX, ZOOM_STEP } from '../utils/utils';\n\nexport type ViewMode = 'collection' | 'grouped';\n\nexport interface ToolbarProps<TItem extends object> {\n hasFilters: boolean;\n filtersOpen: boolean;\n filteredCount: number;\n viewMode: ViewMode;\n zoomLevel: number;\n activeDimensionKey: string;\n dimensions: PivotDimension<TItem>[];\n activeFilterCount: number;\n onFiltersToggle: () => void;\n onViewModeChange: (mode: ViewMode) => void;\n onZoomIn: () => void;\n onZoomOut: () => void;\n onZoomSlider: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onZoomReset: () => void;\n onZoomChange: (zoom: number) => void;\n onDimensionChange: (key: string) => void;\n filterButtonRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nexport function Toolbar<TItem extends object>({\n hasFilters,\n filtersOpen,\n filteredCount,\n viewMode,\n zoomLevel,\n activeDimensionKey,\n dimensions,\n activeFilterCount,\n onFiltersToggle,\n onViewModeChange,\n onZoomIn,\n onZoomOut,\n onZoomSlider,\n onZoomReset,\n onZoomChange,\n onDimensionChange,\n filterButtonRef,\n}: ToolbarProps<TItem>) {\n const labelText = 'Sort by';\n const [isEditingZoom, setIsEditingZoom] = useState(false);\n const [zoomInputValue, setZoomInputValue] = useState('');\n\n const handleZoomClick = () => {\n setIsEditingZoom(true);\n setZoomInputValue(String(Math.round(zoomLevel * 100)));\n };\n\n const handleZoomInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n if (value === '' || /^\\d+$/.test(value)) {\n setZoomInputValue(value);\n }\n };\n\n const handleZoomInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n applyZoomInput();\n } else if (e.key === 'Escape') {\n setIsEditingZoom(false);\n }\n };\n\n const handleZoomInputBlur = () => {\n applyZoomInput();\n };\n\n const applyZoomInput = () => {\n const numValue = parseInt(zoomInputValue, 10);\n if (!isNaN(numValue)) {\n const clampedValue = Math.max(10, Math.min(300, numValue));\n onZoomChange(clampedValue / 100);\n }\n setIsEditingZoom(false);\n };\n\n return (\n <header className=\"pv-toolbar\">\n <div className=\"pv-toolbar-left\">\n {hasFilters && (\n <button\n ref={filterButtonRef}\n type=\"button\"\n className={`pv-filter-icon-button ${filtersOpen ? 'active' : ''}`}\n onClick={onFiltersToggle}\n title=\"Filters\"\n >\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polygon points=\"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3\" />\n </svg>\n {activeFilterCount > 0 && (\n <span className=\"pv-filter-badge\">{activeFilterCount}</span>\n )}\n </button>\n )}\n <h1>Pivot Viewer</h1>\n <span className=\"pv-count\">{filteredCount} events</span>\n </div>\n <div className=\"pv-toolbar-right\">\n <div className=\"pv-zoom-controls\">\n <button\n type=\"button\"\n onClick={onZoomOut}\n disabled={zoomLevel <= ZOOM_MIN}\n title=\"Zoom out\"\n >\n −\n </button>\n <input\n type=\"range\"\n className=\"pv-zoom-slider\"\n min={ZOOM_MIN}\n max={ZOOM_MAX}\n step={ZOOM_STEP}\n value={zoomLevel}\n onChange={onZoomSlider}\n title={`Zoom: ${Math.round(zoomLevel * 100)}%`}\n />\n {isEditingZoom ? (\n <input\n type=\"text\"\n className=\"pv-zoom-level-input\"\n value={zoomInputValue}\n onChange={handleZoomInputChange}\n onKeyDown={handleZoomInputKeyDown}\n onBlur={handleZoomInputBlur}\n autoFocus\n />\n ) : (\n <span className=\"pv-zoom-level\" onClick={handleZoomClick} title=\"Click to edit zoom level\">\n {Math.round(zoomLevel * 100)}%\n </span>\n )}\n <button\n type=\"button\"\n onClick={onZoomReset}\n title=\"Reset zoom\"\n className=\"pv-zoom-reset\"\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M3 21v-5h5\" />\n </svg>\n </button>\n <button\n type=\"button\"\n onClick={onZoomIn}\n disabled={zoomLevel >= ZOOM_MAX}\n title=\"Zoom in\"\n >\n +\n </button>\n </div>\n <div className=\"pv-view-toggle\">\n <button\n type=\"button\"\n className={viewMode === 'collection' ? 'active' : ''}\n onClick={() => onViewModeChange('collection')}\n >\n Collection\n </button>\n <button\n type=\"button\"\n className={viewMode === 'grouped' ? 'active' : ''}\n onClick={() => onViewModeChange('grouped')}\n >\n Grouped\n </button>\n </div>\n <label className=\"pv-dimension-select\">\n <span>{labelText}</span>\n <select\n value={activeDimensionKey}\n onChange={(event) => onDimensionChange(event.target.value)}\n >\n {dimensions.map((dimension) => (\n <option key={dimension.key} value={dimension.key}>\n {dimension.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n </header>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;SA6BgB,OAAO,CAAuB,EAC5C,UAAU,EACV,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,eAAe,GACK,EAAA;IACpB,MAAM,SAAS,GAAG,SAAS;IAC3B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IACzD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IAExD,MAAM,eAAe,GAAG,MAAK;QAC3B,gBAAgB,CAAC,IAAI,CAAC;AACtB,QAAA,iBAAiB,CA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,CACV,CAAC,EAAA,CACK,CAAA,EAAA,CACH,CAAA,EAAA,CACJ,CAAA,EAAA,CACC;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/constants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,eAAe,OAAO,CAAC;AACpC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,QAAQ,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/constants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,eAAe,OAAO,CAAC;AACpC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,QAAQ,IAAI,CAAC;AAG1B,eAAO,MAAM,cAAc;;;;;;;CAO1B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,cAAc,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC;IACrB,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IACtB,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;;AAED,wBAAkB"}
|
|
@@ -2,12 +2,12 @@ const CARD_PADDING = 10;
|
|
|
2
2
|
const CARD_RADIUS = 12;
|
|
3
3
|
const CARD_GAP = 8;
|
|
4
4
|
const DEFAULT_COLORS = {
|
|
5
|
-
base:
|
|
6
|
-
mid:
|
|
7
|
-
gradient:
|
|
8
|
-
border:
|
|
5
|
+
base: 0x0f2745,
|
|
6
|
+
mid: 0x163359,
|
|
7
|
+
gradient: 0x0b1e36,
|
|
8
|
+
border: 0x2e66ba,
|
|
9
9
|
text: 0xffffff,
|
|
10
|
-
textSecondary:
|
|
10
|
+
textSecondary: 0xa8b2c2,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export { CARD_GAP, CARD_PADDING, CARD_RADIUS, DEFAULT_COLORS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../PivotViewer/components/pivot/constants.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type * as PIXI from 'pixi.js';\n\nexport const ANIMATION_SPEED = 0.15;\nexport const CARD_PADDING = 10;\nexport const CARD_RADIUS = 12;\nexport const CARD_GAP = 8; // Gap between cards (must match layout gap)\n\nexport const DEFAULT_COLORS = {\n base:
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../PivotViewer/components/pivot/constants.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type * as PIXI from 'pixi.js';\n\nexport const ANIMATION_SPEED = 0.15;\nexport const CARD_PADDING = 10;\nexport const CARD_RADIUS = 12;\nexport const CARD_GAP = 8; // Gap between cards (must match layout gap)\n\n// Fallbacks tuned to PrimeReact lara-dark-blue aesthetic; actual values resolved from CSS variables\nexport const DEFAULT_COLORS = {\n base: 0x0f2745, // surface-b-ish deep blue\n mid: 0x163359, // surface-a-ish\n gradient: 0x0b1e36, // ground backdrop\n border: 0x2e66ba, // primary-500 for accents\n text: 0xffffff,\n textSecondary: 0xa8b2c2,\n};\n\nexport type CardColors = typeof DEFAULT_COLORS;\n\nexport interface CardSprite {\n container: PIXI.Container;\n graphics: PIXI.Graphics;\n titleText: PIXI.Text;\n labelsText: PIXI.Text;\n valuesText: PIXI.Text;\n itemId: number | string;\n targetX: number;\n targetY: number;\n currentX: number;\n currentY: number;\n // Animation state\n animationStartTime?: number;\n animationDelay?: number;\n startX?: number;\n startY?: number;\n // Cache state to avoid unnecessary redraws\n lastSelectedId?: string | number | null;\n lastCardColors?: CardColors;\n lastTitle?: string;\n lastLabels?: string;\n lastValues?: string;\n}\n\nexport default {};\n"],"names":[],"mappings":"AAMO,MAAM,YAAY,GAAG;AACrB,MAAM,WAAW,GAAG;AACpB,MAAM,QAAQ,GAAG;AAGjB,MAAM,cAAc,GAAG;AAC5B,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,GAAG,EAAE,QAAQ;AACb,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,aAAa,EAAE,QAAQ;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/groups.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvE,wBAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/groups.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvE,wBAAgB,sBAAsB,CAClC,eAAe,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,EACtC,SAAS,EAAE,cAAc,GAAG,IAAI,EAChC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,QA2FnB;AAED,wBAAgB,eAAe,CAC3B,eAAe,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,EACtC,SAAS,EAAE,cAAc,GAAG,IAAI,EAChC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,YAAY,EACpB,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,QA0EpB"}
|
|
@@ -90,8 +90,8 @@ function updateHighlight(groupsContainer, container, grouping, layout, hoveredGr
|
|
|
90
90
|
const groupXs = layout.groupXs || [];
|
|
91
91
|
const widthFromLayout = bucketWidths[hoveredGroupIndex];
|
|
92
92
|
const xFromLayout = groupXs[hoveredGroupIndex];
|
|
93
|
-
let rectX
|
|
94
|
-
let rectWidth
|
|
93
|
+
let rectX;
|
|
94
|
+
let rectWidth;
|
|
95
95
|
if (widthFromLayout !== undefined && xFromLayout !== undefined) {
|
|
96
96
|
rectX = xFromLayout;
|
|
97
97
|
rectWidth = widthFromLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.js","sources":["../../../../../PivotViewer/components/pivot/groups.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport * as PIXI from 'pixi.js';\nimport type { CardColors } from './constants';\nimport type { GroupingResult, LayoutResult } from '../../engine/types';\n\nexport function updateGroupBackgrounds(\n groupsContainer: PIXI.Container | null,\n container: HTMLDivElement | null,\n grouping: GroupingResult,\n layout: LayoutResult,\n zoomLevel: number,\n cardColors: CardColors,\n viewMode: string,\n) {\n if (!groupsContainer) return;\n\n // keep parameter referenced to avoid unused param lint when callers pass zoomLevel\n void zoomLevel;\n\n if (!container || grouping.groups.length === 0 || viewMode === 'collection') {\n // If we shouldn't show anything, hide all existing backgrounds\n // We keep the highlight if it exists\n for (const child of groupsContainer.children) {\n if ((child as unknown as { name?: string }).name !== 'highlight') {\n child.visible = false;\n }\n }\n return;\n }\n\n // Derive a world-space height that always covers the visible viewport even when zoomed out.\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n const containerWorldHeight = Math.max(\n (container.scrollHeight || container.clientHeight) * invScale,\n container.clientHeight * invScale,\n );\n const baseWorldHeight = Math.max(layout.totalHeight || 0, containerWorldHeight);\n // Use larger buffer and extend further above the viewport to ensure full coverage\n // when zoomed out and cards are positioned at the bottom\n const bufferWorld = Math.max(500, baseWorldHeight * 0.5, containerWorldHeight);\n const worldHeight = baseWorldHeight + bufferWorld * 3;\n const startY = -bufferWorld * 2;\n\n // Get existing background graphics (excluding highlight)\n const backgroundGraphics = groupsContainer.children.filter(c => (c as unknown as { name?: string }).name !== 'highlight') as PIXI.Graphics[];\n let bgIndex = 0;\n\n // Instead of re-deriving bucket geometry from constants, compute bucket bounds\n // directly from the positions stored in the layout so backgrounds align exactly.\n for (let index = 0; index < grouping.groups.length; index++) {\n const group = grouping.groups[index];\n let minX = Infinity;\n let maxX = -Infinity;\n\n for (let j = 0; j < group.ids.length; j++) {\n const id = group.ids[j];\n const pos = layout.positions.get(id);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n }\n }\n\n if (minX === Infinity && (!layout.groupXs || layout.groupXs[index] === undefined)) continue;\n\n // Prefer explicit bucket width and position from layout when available\n const bucketWidths = layout.bucketWidths || [];\n const groupXs = layout.groupXs || [];\n const widthFromLayout = bucketWidths[index];\n const xFromLayout = groupXs[index];\n\n const width = widthFromLayout && widthFromLayout > 0 ? widthFromLayout : ((maxX - minX) || 0);\n const x = xFromLayout !== undefined ? xFromLayout : minX;\n\n if (index % 2 === 0 && width > 0) {\n let bg: PIXI.Graphics;\n\n if (bgIndex < backgroundGraphics.length) {\n bg = backgroundGraphics[bgIndex];\n bg.clear();\n } else {\n bg = new PIXI.Graphics();\n // Insert before highlight if it exists, otherwise at end\n const highlightIndex = groupsContainer.children.findIndex(c => (c as unknown as { name?: string }).name === 'highlight');\n if (highlightIndex >= 0) {\n groupsContainer.addChildAt(bg, highlightIndex);\n } else {\n groupsContainer.addChild(bg);\n }\n }\n\n bg.rect(x, startY, width, worldHeight);\n bg.fill(cardColors.base);\n bg.alpha = 0.15;\n bg.visible = true;\n bgIndex++;\n }\n }\n\n // Hide unused background graphics\n for (let i = bgIndex; i < backgroundGraphics.length; i++) {\n backgroundGraphics[i].visible = false;\n }\n}\n\nexport function updateHighlight(\n groupsContainer: PIXI.Container | null,\n container: HTMLDivElement | null,\n grouping: GroupingResult,\n layout: LayoutResult,\n hoveredGroupIndex: number | null,\n cardWidth: number,\n zoomLevel: number,\n) {\n if (!groupsContainer || !container || grouping.groups.length === 0) return;\n\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n\n let highlight = groupsContainer.children.find(child => (child as unknown as { name?: string }).name === 'highlight') as PIXI.Graphics;\n\n if (!highlight) {\n highlight = new PIXI.Graphics();\n (highlight as unknown as { name: string }).name = 'highlight';\n groupsContainer.addChild(highlight);\n }\n\n highlight.clear();\n\n if (hoveredGroupIndex === null || hoveredGroupIndex < 0) {\n highlight.visible = false;\n return;\n }\n\n const group = grouping.groups[hoveredGroupIndex];\n if (!group || group.ids.length === 0) {\n highlight.visible = false;\n return;\n }\n\n // Use layout info if available\n const bucketWidths = layout.bucketWidths || [];\n const groupXs = layout.groupXs || [];\n const widthFromLayout = bucketWidths[hoveredGroupIndex];\n const xFromLayout = groupXs[hoveredGroupIndex];\n\n let rectX = 0;\n let rectWidth = 0;\n\n if (widthFromLayout !== undefined && xFromLayout !== undefined) {\n rectX = xFromLayout;\n rectWidth = widthFromLayout;\n } else {\n // Fallback: derive from items bounding box\n let minX = Infinity;\n let maxX = -Infinity;\n\n for (let j = 0; j < group.ids.length; j++) {\n const id = group.ids[j];\n const pos = layout.positions.get(id);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x + cardWidth);\n }\n }\n\n if (minX === Infinity) {\n highlight.visible = false;\n return;\n }\n rectX = minX;\n rectWidth = maxX - minX;\n }\n\n const containerWorldHeight = Math.max(\n (container.scrollHeight || container.clientHeight) * invScale,\n container.clientHeight * invScale,\n );\n const baseWorldHeight = Math.max(layout.totalHeight || 0, containerWorldHeight);\n const bufferWorld = Math.max(200, baseWorldHeight * 0.25);\n const worldHeight = baseWorldHeight + bufferWorld * 2;\n const startY = -bufferWorld;\n\n highlight.rect(rectX, startY, rectWidth, worldHeight);\n highlight.fill(0xffffff);\n highlight.alpha = 0.05;\n highlight.visible = true;\n}\n"],"names":[],"mappings":";;AAOM,SAAU,sBAAsB,CACpC,eAAsC,EACtC,SAAgC,EAChC,QAAwB,EACxB,MAAoB,EACpB,SAAiB,EACjB,UAAsB,EACtB,QAAgB,EAAA;AAEhB,IAAA,IAAI,CAAC,eAAe;QAAE;AAKtB,IAAA,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,KAAK,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pC,IAAI,GAAG,EAAE;gBACP,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAC5B,gBAAA,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;YAC1C;QACF;AAEA,QAAA,IAAI,IAAI,KAAK,QAAQ,EAAE;AACrB,YAAA,SAAS,CAAC,OAAO,GAAG,KAAK;YACzB;QACF;QACA,KAAK,GAAG,IAAI;AACZ,QAAA,SAAS,GAAG,IAAI,GAAG,IAAI;IACzB;IAEA,MAAM,oBAAoB,GAAG,IAAI,CAAC,GAAG,CACnC,CAAC,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,YAAY,IAAI,QAAQ,EAC7D,SAAS,CAAC,YAAY,GAAG,QAAQ,CAClC;AACD,IAAA,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,EAAE,oBAAoB,CAAC;AAC/E,IAAA,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;AACzD,IAAA,MAAM,WAAW,GAAG,eAAe,GAAG,WAAW,GAAG,CAAC;AACrD,IAAA,MAAM,MAAM,GAAG,CAAC,WAAW;IAE3B,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,CAAC;AACrD,IAAA,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AACxB,IAAA,SAAS,CAAC,KAAK,GAAG,IAAI;AACtB,IAAA,SAAS,CAAC,OAAO,GAAG,IAAI;AAC1B;;;;"}
|
|
1
|
+
{"version":3,"file":"groups.js","sources":["../../../../../PivotViewer/components/pivot/groups.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport * as PIXI from 'pixi.js';\nimport type { CardColors } from './constants';\nimport type { GroupingResult, LayoutResult } from '../../engine/types';\n\nexport function updateGroupBackgrounds(\n groupsContainer: PIXI.Container | null,\n container: HTMLDivElement | null,\n grouping: GroupingResult,\n layout: LayoutResult,\n zoomLevel: number,\n cardColors: CardColors,\n viewMode: string,\n) {\n if (!groupsContainer) return;\n\n // keep parameter referenced to avoid unused param lint when callers pass zoomLevel\n void zoomLevel;\n\n if (!container || grouping.groups.length === 0 || viewMode === 'collection') {\n // If we shouldn't show anything, hide all existing backgrounds\n // We keep the highlight if it exists\n for (const child of groupsContainer.children) {\n if ((child as unknown as { name?: string }).name !== 'highlight') {\n child.visible = false;\n }\n }\n return;\n }\n\n // Derive a world-space height that always covers the visible viewport even when zoomed out.\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n const containerWorldHeight = Math.max(\n (container.scrollHeight || container.clientHeight) * invScale,\n container.clientHeight * invScale,\n );\n const baseWorldHeight = Math.max(layout.totalHeight || 0, containerWorldHeight);\n // Use larger buffer and extend further above the viewport to ensure full coverage\n // when zoomed out and cards are positioned at the bottom\n const bufferWorld = Math.max(500, baseWorldHeight * 0.5, containerWorldHeight);\n const worldHeight = baseWorldHeight + bufferWorld * 3;\n const startY = -bufferWorld * 2;\n\n // Get existing background graphics (excluding highlight)\n const backgroundGraphics = groupsContainer.children.filter(c => (c as unknown as { name?: string }).name !== 'highlight') as PIXI.Graphics[];\n let bgIndex = 0;\n\n // Instead of re-deriving bucket geometry from constants, compute bucket bounds\n // directly from the positions stored in the layout so backgrounds align exactly.\n for (let index = 0; index < grouping.groups.length; index++) {\n const group = grouping.groups[index];\n let minX = Infinity;\n let maxX = -Infinity;\n\n for (let j = 0; j < group.ids.length; j++) {\n const id = group.ids[j];\n const pos = layout.positions.get(id);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n }\n }\n\n if (minX === Infinity && (!layout.groupXs || layout.groupXs[index] === undefined)) continue;\n\n // Prefer explicit bucket width and position from layout when available\n const bucketWidths = layout.bucketWidths || [];\n const groupXs = layout.groupXs || [];\n const widthFromLayout = bucketWidths[index];\n const xFromLayout = groupXs[index];\n\n const width = widthFromLayout && widthFromLayout > 0 ? widthFromLayout : ((maxX - minX) || 0);\n const x = xFromLayout !== undefined ? xFromLayout : minX;\n\n if (index % 2 === 0 && width > 0) {\n let bg: PIXI.Graphics;\n\n if (bgIndex < backgroundGraphics.length) {\n bg = backgroundGraphics[bgIndex];\n bg.clear();\n } else {\n bg = new PIXI.Graphics();\n // Insert before highlight if it exists, otherwise at end\n const highlightIndex = groupsContainer.children.findIndex(c => (c as unknown as { name?: string }).name === 'highlight');\n if (highlightIndex >= 0) {\n groupsContainer.addChildAt(bg, highlightIndex);\n } else {\n groupsContainer.addChild(bg);\n }\n }\n\n bg.rect(x, startY, width, worldHeight);\n bg.fill(cardColors.base);\n bg.alpha = 0.15;\n bg.visible = true;\n bgIndex++;\n }\n }\n\n // Hide unused background graphics\n for (let i = bgIndex; i < backgroundGraphics.length; i++) {\n backgroundGraphics[i].visible = false;\n }\n}\n\nexport function updateHighlight(\n groupsContainer: PIXI.Container | null,\n container: HTMLDivElement | null,\n grouping: GroupingResult,\n layout: LayoutResult,\n hoveredGroupIndex: number | null,\n cardWidth: number,\n zoomLevel: number,\n) {\n if (!groupsContainer || !container || grouping.groups.length === 0) return;\n\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n\n let highlight = groupsContainer.children.find(child => (child as unknown as { name?: string }).name === 'highlight') as PIXI.Graphics;\n\n if (!highlight) {\n highlight = new PIXI.Graphics();\n (highlight as unknown as { name: string }).name = 'highlight';\n groupsContainer.addChild(highlight);\n }\n\n highlight.clear();\n\n if (hoveredGroupIndex === null || hoveredGroupIndex < 0) {\n highlight.visible = false;\n return;\n }\n\n const group = grouping.groups[hoveredGroupIndex];\n if (!group || group.ids.length === 0) {\n highlight.visible = false;\n return;\n }\n\n // Use layout info if available\n const bucketWidths = layout.bucketWidths || [];\n const groupXs = layout.groupXs || [];\n const widthFromLayout = bucketWidths[hoveredGroupIndex];\n const xFromLayout = groupXs[hoveredGroupIndex];\n\n let rectX: number;\n let rectWidth: number;\n\n if (widthFromLayout !== undefined && xFromLayout !== undefined) {\n rectX = xFromLayout;\n rectWidth = widthFromLayout;\n } else {\n // Fallback: derive from items bounding box\n let minX = Infinity;\n let maxX = -Infinity;\n\n for (let j = 0; j < group.ids.length; j++) {\n const id = group.ids[j];\n const pos = layout.positions.get(id);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x + cardWidth);\n }\n }\n\n if (minX === Infinity) {\n highlight.visible = false;\n return;\n }\n rectX = minX;\n rectWidth = maxX - minX;\n }\n\n const containerWorldHeight = Math.max(\n (container.scrollHeight || container.clientHeight) * invScale,\n container.clientHeight * invScale,\n );\n const baseWorldHeight = Math.max(layout.totalHeight || 0, containerWorldHeight);\n const bufferWorld = Math.max(200, baseWorldHeight * 0.25);\n const worldHeight = baseWorldHeight + bufferWorld * 2;\n const startY = -bufferWorld;\n\n highlight.rect(rectX, startY, rectWidth, worldHeight);\n highlight.fill(0xffffff);\n highlight.alpha = 0.05;\n highlight.visible = true;\n}\n"],"names":[],"mappings":";;AAOM,SAAU,sBAAsB,CAClC,eAAsC,EACtC,SAAgC,EAChC,QAAwB,EACxB,MAAoB,EACpB,SAAiB,EACjB,UAAsB,EACtB,QAAgB,EAAA;AAEhB,IAAA,IAAI,CAAC,eAAe;QAAE;AAKtB,IAAA,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,KAAK,YAAY,EAAE;AAGzE,QAAA,KAAK,MAAM,KAAK,IAAI,eAAe,CAAC,QAAQ,EAAE;AAC1C,YAAA,IAAK,KAAsC,CAAC,IAAI,KAAK,WAAW,EAAE;AAC9D,gBAAA,KAAK,CAAC,OAAO,GAAG,KAAK;YACzB;QACJ;QACA;IACJ;AAGA,IA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;AAEA,QAAA,IAAI,IAAI,KAAK,QAAQ,EAAE;AACnB,YAAA,SAAS,CAAC,OAAO,GAAG,KAAK;YACzB;QACJ;QACA,KAAK,GAAG,IAAI;AACZ,QAAA,SAAS,GAAG,IAAI,GAAG,IAAI;IAC3B;IAEA,MAAM,oBAAoB,GAAG,IAAI,CAAC,GAAG,CACjC,CAAC,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,YAAY,IAAI,QAAQ,EAC7D,SAAS,CAAC,YAAY,GAAG,QAAQ,CACpC;AACD,IAAA,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,EAAE,oBAAoB,CAAC;AAC/E,IAAA,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;AACzD,IAAA,MAAM,WAAW,GAAG,eAAe,GAAG,WAAW,GAAG,CAAC;AACrD,IAAA,MAAM,MAAM,GAAG,CAAC,WAAW;IAE3B,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,CAAC;AACrD,IAAA,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AACxB,IAAA,SAAS,CAAC,KAAK,GAAG,IAAI;AACtB,IAAA,SAAS,CAAC,OAAO,GAAG,IAAI;AAC5B;;;;"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { CardSprite, CardColors } from './constants';
|
|
2
|
-
export declare function createCardSprite<TItem extends object>(id: number | string, x: number, y: number, items: TItem[], onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void, onPanStart: (e: MouseEvent) => void, cardWidth: number, cardHeight: number, cardColors: CardColors
|
|
2
|
+
export declare function createCardSprite<TItem extends object>(id: number | string, x: number, y: number, items: TItem[], onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void, onPanStart: (e: MouseEvent) => void, cardWidth: number, cardHeight: number, cardColors: CardColors, cardRenderer: (item: TItem) => {
|
|
3
|
+
title: string;
|
|
4
|
+
labels?: string[];
|
|
5
|
+
values?: string[];
|
|
6
|
+
}, resolveId: (item: TItem, index: number) => string | number): CardSprite;
|
|
3
7
|
export declare function destroySprite(sprite: CardSprite): void;
|
|
4
8
|
export declare function clearSpritePool(): void;
|
|
5
|
-
export declare function updateCardContent<TItem extends object>(sprite: CardSprite, item: TItem, selectedId: string | number | null, cardWidth: number, cardHeight: number, cardColors: CardColors
|
|
9
|
+
export declare function updateCardContent<TItem extends object>(sprite: CardSprite, item: TItem, selectedId: string | number | null, cardWidth: number, cardHeight: number, cardColors: CardColors, cardRenderer: (item: TItem) => {
|
|
10
|
+
title: string;
|
|
11
|
+
labels?: string[];
|
|
12
|
+
values?: string[];
|
|
13
|
+
}): void;
|
|
6
14
|
//# sourceMappingURL=sprites.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/sprites.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI1D,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,MAAM,EACnD,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,KAAK,EAAE,EACd,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,EACtE,UAAU,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,EACnC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/sprites.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EA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|
2
2
|
import { CARD_RADIUS, CARD_PADDING, CARD_GAP } from './constants.js';
|
|
3
3
|
|
|
4
4
|
const spritePool = [];
|
|
5
|
-
function createCardSprite(id, x, y, items, onCardClick, onPanStart, cardWidth, cardHeight, cardColors) {
|
|
5
|
+
function createCardSprite(id, x, y, items, onCardClick, onPanStart, cardWidth, cardHeight, cardColors, cardRenderer, resolveId) {
|
|
6
6
|
if (spritePool.length > 0) {
|
|
7
7
|
const sprite = spritePool.pop();
|
|
8
8
|
if (sprite.container) {
|
|
@@ -71,7 +71,7 @@ function createCardSprite(id, x, y, items, onCardClick, onPanStart, cardWidth, c
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
if (sprite.container) {
|
|
74
|
-
sprite.container._eventContext = { items, onCardClick, id };
|
|
74
|
+
sprite.container._eventContext = { items, onCardClick, id, cardRenderer, resolveId };
|
|
75
75
|
}
|
|
76
76
|
return sprite;
|
|
77
77
|
}
|
|
@@ -80,7 +80,7 @@ function createCardSprite(id, x, y, items, onCardClick, onPanStart, cardWidth, c
|
|
|
80
80
|
container.cursor = 'pointer';
|
|
81
81
|
container.position.set(x, y);
|
|
82
82
|
container.hitArea = new PIXI.Rectangle(CARD_GAP / 2, CARD_GAP / 2, cardWidth - CARD_GAP, cardHeight - CARD_GAP);
|
|
83
|
-
container._eventContext = { items, onCardClick, id };
|
|
83
|
+
container._eventContext = { items, onCardClick, id, cardRenderer, resolveId };
|
|
84
84
|
const graphics = new PIXI.Graphics();
|
|
85
85
|
const actualWidth = cardWidth - CARD_GAP;
|
|
86
86
|
const actualHeight = cardHeight - CARD_GAP;
|
|
@@ -122,7 +122,8 @@ function createCardSprite(id, x, y, items, onCardClick, onPanStart, cardWidth, c
|
|
|
122
122
|
e.stopPropagation();
|
|
123
123
|
const ctx = container._eventContext;
|
|
124
124
|
const itemsArray = ctx.items;
|
|
125
|
-
const
|
|
125
|
+
const numericId = typeof ctx.id === 'number' ? ctx.id : Number(ctx.id);
|
|
126
|
+
const item = itemsArray[numericId];
|
|
126
127
|
if (item) {
|
|
127
128
|
ctx.onCardClick(item, e.nativeEvent, ctx.id);
|
|
128
129
|
}
|
|
@@ -152,32 +153,14 @@ function destroySprite(sprite) {
|
|
|
152
153
|
}
|
|
153
154
|
spritePool.push(sprite);
|
|
154
155
|
}
|
|
155
|
-
function updateCardContent(sprite, item, selectedId, cardWidth, cardHeight, cardColors) {
|
|
156
|
+
function updateCardContent(sprite, item, selectedId, cardWidth, cardHeight, cardColors, cardRenderer) {
|
|
156
157
|
if (!item)
|
|
157
158
|
return;
|
|
158
|
-
const event = item;
|
|
159
|
-
const eventType = String(event.type || event.name || event.title || 'Event');
|
|
160
|
-
const timeStr = event.occurred ? new Date(event.occurred).toLocaleString('en-US', {
|
|
161
|
-
month: '2-digit',
|
|
162
|
-
day: '2-digit',
|
|
163
|
-
year: 'numeric',
|
|
164
|
-
hour: '2-digit',
|
|
165
|
-
minute: '2-digit',
|
|
166
|
-
hour12: false
|
|
167
|
-
}).replace(',', '') : '';
|
|
168
|
-
const correlation = event.correlationId || event.correlation || '';
|
|
169
|
-
const correlationShort = correlation ? String(correlation).substring(0, 12) + '...' : '';
|
|
170
|
-
const maxTitleLength = 20;
|
|
171
|
-
const titleDisplay = eventType.length > maxTitleLength
|
|
172
|
-
? eventType.substring(0, maxTitleLength) + '...'
|
|
173
|
-
: eventType;
|
|
174
|
-
const maxTypeLength = 16;
|
|
175
|
-
const typeDisplay = eventType.length > maxTypeLength
|
|
176
|
-
? eventType.substring(0, maxTypeLength) + '...'
|
|
177
|
-
: eventType;
|
|
178
159
|
const colors = cardColors;
|
|
179
|
-
const
|
|
180
|
-
const
|
|
160
|
+
const cardData = cardRenderer(item);
|
|
161
|
+
const titleDisplay = cardData.title;
|
|
162
|
+
const labelsText = (cardData.labels || []).join('\n');
|
|
163
|
+
const valuesText = (cardData.values || []).join('\n');
|
|
181
164
|
const colorsChanged = sprite.lastCardColors !== colors;
|
|
182
165
|
if (!sprite.titleText || sprite.titleText.destroyed)
|
|
183
166
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprites.js","sources":["../../../../../PivotViewer/components/pivot/sprites.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport * as PIXI from 'pixi.js';\nimport { CARD_GAP, CARD_PADDING, CARD_RADIUS } from './constants';\nimport type { CardSprite, CardColors } from './constants';\n\nconst spritePool: CardSprite[] = [];\n\nexport function createCardSprite<TItem extends object>(\n id: number | string,\n x: number,\n y: number,\n items: TItem[],\n onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void,\n onPanStart: (e: MouseEvent) => void,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n): CardSprite {\n if (spritePool.length > 0) {\n const sprite = spritePool.pop()!;\n if (sprite.container) {\n sprite.container.visible = true;\n sprite.container.alpha = 1;\n sprite.container.position.set(x, y);\n }\n sprite.itemId = id;\n sprite.targetX = x;\n sprite.targetY = y;\n sprite.currentX = x;\n sprite.currentY = y;\n\n // Reset animation state\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n delete sprite.startX;\n delete sprite.startY;\n\n // Reset cache\n sprite.lastSelectedId = null;\n sprite.lastCardColors = undefined;\n sprite.lastTitle = undefined;\n sprite.lastLabels = undefined;\n sprite.lastValues = undefined;\n\n // Recreate graphics if it was destroyed\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n }\n\n // Recreate text objects if they were destroyed\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n \n if (!sprite.titleText || sprite.titleText.destroyed) {\n sprite.titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n if (sprite.container) {\n sprite.container.addChild(sprite.titleText);\n }\n }\n\n if (!sprite.labelsText || sprite.labelsText.destroyed) {\n sprite.labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n sprite.labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.labelsText);\n }\n }\n\n if (!sprite.valuesText || sprite.valuesText.destroyed) {\n sprite.valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.valuesText);\n }\n }\n\n // Update event context\n if (sprite.container) {\n (sprite.container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext = { items, onCardClick, id };\n }\n\n return sprite;\n }\n\n const container = new PIXI.Container();\n container.eventMode = 'static';\n container.cursor = 'pointer';\n container.position.set(x, y);\n\n // Define hit area to match the visible card size (excluding gaps)\n // This ensures the entire card is clickable and avoids issues with text blocking hits\n container.hitArea = new PIXI.Rectangle(\n CARD_GAP / 2,\n CARD_GAP / 2,\n cardWidth - CARD_GAP,\n cardHeight - CARD_GAP\n );\n\n // Store context for event handlers\n (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext = { items, onCardClick, id };\n\n const graphics = new PIXI.Graphics();\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n gradient.addColorStop(0, cardColors.mid);\n gradient.addColorStop(1, cardColors.base);\n\n graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n graphics.fill(gradient);\n\n container.addChild(graphics);\n\n const titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n container.addChild(titleText);\n\n const labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n container.addChild(labelsText);\n\n const valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n container.addChild(valuesText);\n\n container.on('click', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n const ctx = (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext;\n const itemsArray = ctx.items;\n const item = itemsArray[Number(ctx.id)];\n if (item) {\n ctx.onCardClick(item, e.nativeEvent as MouseEvent, ctx.id);\n }\n });\n\n container.on('pointerdown', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n // onPanStart(e.nativeEvent as MouseEvent);\n });\n\n return {\n container,\n graphics,\n titleText,\n labelsText,\n valuesText,\n itemId: id,\n targetX: x,\n targetY: y,\n currentX: x,\n currentY: y,\n };\n}\n\nexport function destroySprite(sprite: CardSprite) {\n if (sprite.container && sprite.container.parent) {\n sprite.container.parent.removeChild(sprite.container);\n }\n // Reset visibility to ensure it doesn't ghost if something goes wrong\n if (sprite.container) {\n sprite.container.visible = false;\n }\n spritePool.push(sprite);\n}\n\nexport function clearSpritePool() {\n for (const sprite of spritePool) {\n try {\n sprite.graphics?.destroy();\n sprite.titleText?.destroy();\n sprite.labelsText?.destroy();\n sprite.valuesText?.destroy();\n sprite.container?.destroy();\n } catch (e) {\n void e;\n }\n }\n spritePool.length = 0;\n}\n\n// Updated: Text objects now recreated when recycling pooled sprites\nexport function updateCardContent<TItem extends object>(\n sprite: CardSprite,\n item: TItem,\n selectedId: string | number | null,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n) {\n if (!item) return;\n\n const event = item as unknown as Record<string, unknown>;\n const eventType = String(event.type || event.name || event.title || 'Event');\n\n const timeStr = event.occurred ? new Date(event.occurred as string | number | Date).toLocaleString('en-US', {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n hour12: false\n }).replace(',', '') : '';\n\n const correlation = event.correlationId || event.correlation || '';\n const correlationShort = correlation ? String(correlation).substring(0, 12) + '...' : '';\n\n const maxTitleLength = 20;\n const titleDisplay = eventType.length > maxTitleLength\n ? eventType.substring(0, maxTitleLength) + '...'\n : eventType;\n\n const maxTypeLength = 16;\n const typeDisplay = eventType.length > maxTypeLength\n ? eventType.substring(0, maxTypeLength) + '...'\n : eventType;\n\n const colors = cardColors;\n const labelsText = 'Type\\nOccurred\\nCorrelation';\n const valuesText = `${typeDisplay}\\n${timeStr}\\n${correlationShort}`;\n const colorsChanged = sprite.lastCardColors !== colors;\n\n // Ensure text objects exist before using them\n if (!sprite.titleText || sprite.titleText.destroyed) return;\n if (!sprite.labelsText || sprite.labelsText.destroyed) return;\n if (!sprite.valuesText || sprite.valuesText.destroyed) return;\n\n if (sprite.lastTitle !== titleDisplay) {\n sprite.titleText.text = titleDisplay;\n sprite.lastTitle = titleDisplay;\n }\n\n if (sprite.lastLabels !== labelsText) {\n sprite.labelsText.text = labelsText;\n sprite.lastLabels = labelsText;\n }\n\n if (colorsChanged && sprite.labelsText.style) {\n (sprite.labelsText.style as unknown as { fill: string | number }).fill = colors.textSecondary;\n }\n\n if (sprite.lastValues !== valuesText) {\n sprite.valuesText.text = valuesText;\n sprite.lastValues = valuesText;\n }\n\n if (colorsChanged && sprite.valuesText.style) {\n (sprite.valuesText.style as unknown as { fill: string | number }).fill = colors.text;\n }\n\n sprite.titleText.visible = true;\n sprite.labelsText.visible = true;\n sprite.valuesText.visible = true;\n\n const isSelected = sprite.itemId === selectedId;\n\n // Only redraw graphics if selection state or colors changed\n if (sprite.lastSelectedId === selectedId && !colorsChanged && sprite.graphics) {\n return;\n }\n\n sprite.lastSelectedId = selectedId;\n sprite.lastCardColors = cardColors;\n\n // Ensure graphics exists before attempting to use it\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n } else {\n sprite.graphics.clear();\n }\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n if (isSelected) {\n gradient.addColorStop(0, colors.gradient);\n gradient.addColorStop(1, colors.mid);\n } else {\n gradient.addColorStop(0, colors.mid);\n gradient.addColorStop(1, colors.base);\n }\n\n sprite.graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n \n // Ensure graphics is still valid before filling\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.fill(gradient);\n }\n\n if (isSelected) {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 2, color: colors.border });\n }\n } else {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 1, color: colors.border, alpha: 0.35 });\n }\n }\n}\n"],"names":[],"mappings":";;;AAOA,MAAM,UAAU,GAAiB,EAAE;SAEnB,gBAAgB,CAC9B,EAAmB,EACn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M,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzE;IACF;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"sprites.js","sources":["../../../../../PivotViewer/components/pivot/sprites.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport * as PIXI from 'pixi.js';\nimport { CARD_GAP, CARD_PADDING, CARD_RADIUS } from './constants';\nimport type { CardSprite, CardColors } from './constants';\n\nconst spritePool: CardSprite[] = [];\n\nexport function createCardSprite<TItem extends object>(\n id: number | string,\n x: number,\n y: number,\n items: TItem[],\n onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void,\n onPanStart: (e: MouseEvent) => void,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n cardRenderer: (item: TItem) => { title: string; labels?: string[]; values?: string[] },\n resolveId: (item: TItem, index: number) => string | number,\n): CardSprite {\n if (spritePool.length > 0) {\n const sprite = spritePool.pop()!;\n if (sprite.container) {\n sprite.container.visible = true;\n sprite.container.alpha = 1;\n sprite.container.position.set(x, y);\n }\n sprite.itemId = id;\n sprite.targetX = x;\n sprite.targetY = y;\n sprite.currentX = x;\n sprite.currentY = y;\n\n // Reset animation state\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n delete sprite.startX;\n delete sprite.startY;\n\n // Reset cache\n sprite.lastSelectedId = null;\n sprite.lastCardColors = undefined;\n sprite.lastTitle = undefined;\n sprite.lastLabels = undefined;\n sprite.lastValues = undefined;\n\n // Recreate graphics if it was destroyed\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n }\n\n // Recreate text objects if they were destroyed\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n \n if (!sprite.titleText || sprite.titleText.destroyed) {\n sprite.titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n if (sprite.container) {\n sprite.container.addChild(sprite.titleText);\n }\n }\n\n if (!sprite.labelsText || sprite.labelsText.destroyed) {\n sprite.labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n sprite.labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.labelsText);\n }\n }\n\n if (!sprite.valuesText || sprite.valuesText.destroyed) {\n sprite.valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.valuesText);\n }\n }\n\n // Update event context\n if (sprite.container) {\n (sprite.container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string; cardRenderer: (item: TItem) => { title: string; labels?: string[]; values?: string[] }; resolveId: (item: TItem, index: number) => string | number } })._eventContext = { items, onCardClick, id, cardRenderer, resolveId };\n }\n\n return sprite;\n }\n\n const container = new PIXI.Container();\n container.eventMode = 'static';\n container.cursor = 'pointer';\n container.position.set(x, y);\n\n // Define hit area to match the visible card size (excluding gaps)\n // This ensures the entire card is clickable and avoids issues with text blocking hits\n container.hitArea = new PIXI.Rectangle(\n CARD_GAP / 2,\n CARD_GAP / 2,\n cardWidth - CARD_GAP,\n cardHeight - CARD_GAP\n );\n\n // Container configured for pointer interactions; hitArea matches visible card.\n\n // Store context for event handlers\n (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string; cardRenderer: (item: TItem) => { title: string; labels?: string[]; values?: string[] }; resolveId: (item: TItem, index: number) => string | number } })._eventContext = { items, onCardClick, id, cardRenderer, resolveId };\n\n const graphics = new PIXI.Graphics();\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n gradient.addColorStop(0, cardColors.mid);\n gradient.addColorStop(1, cardColors.base);\n\n graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n graphics.fill(gradient);\n\n container.addChild(graphics);\n\n const titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n container.addChild(titleText);\n\n const labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n container.addChild(labelsText);\n\n const valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n container.addChild(valuesText);\n\n container.on('click', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n const ctx = (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext;\n const itemsArray = ctx.items;\n const numericId = typeof ctx.id === 'number' ? ctx.id : Number(ctx.id);\n const item = itemsArray[numericId];\n if (item) {\n ctx.onCardClick(item, e.nativeEvent as MouseEvent, ctx.id);\n }\n });\n\n container.on('pointerdown', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n // onPanStart(e.nativeEvent as MouseEvent);\n });\n\n return {\n container,\n graphics,\n titleText,\n labelsText,\n valuesText,\n itemId: id,\n targetX: x,\n targetY: y,\n currentX: x,\n currentY: y,\n };\n}\n\nexport function destroySprite(sprite: CardSprite) {\n if (sprite.container && sprite.container.parent) {\n sprite.container.parent.removeChild(sprite.container);\n }\n // Reset visibility to ensure it doesn't ghost if something goes wrong\n if (sprite.container) {\n sprite.container.visible = false;\n }\n spritePool.push(sprite);\n}\n\nexport function clearSpritePool() {\n for (const sprite of spritePool) {\n try {\n sprite.graphics?.destroy();\n sprite.titleText?.destroy();\n sprite.labelsText?.destroy();\n sprite.valuesText?.destroy();\n sprite.container?.destroy();\n } catch (e) {\n void e;\n }\n }\n spritePool.length = 0;\n}\n\n// Updated: Text objects now recreated when recycling pooled sprites\nexport function updateCardContent<TItem extends object>(\n sprite: CardSprite,\n item: TItem,\n selectedId: string | number | null,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n cardRenderer: (item: TItem) => { title: string; labels?: string[]; values?: string[] },\n) {\n if (!item) return;\n\n // Selection rendering depends on sprite.itemId matching selectedId\n\n const colors = cardColors;\n const cardData = cardRenderer(item);\n const titleDisplay = cardData.title;\n const labelsText = (cardData.labels || []).join('\\n');\n const valuesText = (cardData.values || []).join('\\n');\n const colorsChanged = sprite.lastCardColors !== colors;\n\n // Ensure text objects exist before using them\n if (!sprite.titleText || sprite.titleText.destroyed) return;\n if (!sprite.labelsText || sprite.labelsText.destroyed) return;\n if (!sprite.valuesText || sprite.valuesText.destroyed) return;\n\n if (sprite.lastTitle !== titleDisplay) {\n sprite.titleText.text = titleDisplay;\n sprite.lastTitle = titleDisplay;\n }\n\n if (sprite.lastLabels !== labelsText) {\n sprite.labelsText.text = labelsText;\n sprite.lastLabels = labelsText;\n }\n\n if (colorsChanged && sprite.labelsText.style) {\n (sprite.labelsText.style as unknown as { fill: string | number }).fill = colors.textSecondary;\n }\n\n if (sprite.lastValues !== valuesText) {\n sprite.valuesText.text = valuesText;\n sprite.lastValues = valuesText;\n }\n\n if (colorsChanged && sprite.valuesText.style) {\n (sprite.valuesText.style as unknown as { fill: string | number }).fill = colors.text;\n }\n\n sprite.titleText.visible = true;\n sprite.labelsText.visible = true;\n sprite.valuesText.visible = true;\n\n const isSelected = sprite.itemId === selectedId;\n\n // Only redraw graphics if selection state or colors changed\n if (sprite.lastSelectedId === selectedId && !colorsChanged && sprite.graphics) {\n return;\n }\n\n sprite.lastSelectedId = selectedId;\n sprite.lastCardColors = cardColors;\n\n // Ensure graphics exists before attempting to use it\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n } else {\n sprite.graphics.clear();\n }\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n if (isSelected) {\n gradient.addColorStop(0, colors.gradient);\n gradient.addColorStop(1, colors.mid);\n } else {\n gradient.addColorStop(0, colors.mid);\n gradient.addColorStop(1, colors.base);\n }\n\n sprite.graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n \n // Ensure graphics is still valid before filling\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.fill(gradient);\n }\n\n if (isSelected) {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 2, color: colors.border });\n }\n } else {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 1, color: colors.border, alpha: 0.35 });\n }\n }\n}\n"],"names":[],"mappings":";;;AAOA,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ualScrollY);
|
|
24
24
|
}
|
|
25
|
-
if (isViewTransition && (panDeltaX || panDeltaY)) {
|
|
26
|
-
const dx = (panDeltaX || 0) / (zoomLevel || 1);
|
|
27
|
-
const dy = (panDeltaY || 0) / (zoomLevel || 1);
|
|
28
|
-
for (const sprite of sprites.values()) {
|
|
29
|
-
if (sprite.animationStartTime !== undefined) {
|
|
30
|
-
if (sprite.startX !== undefined)
|
|
31
|
-
sprite.startX += dx;
|
|
32
|
-
if (sprite.startY !== undefined)
|
|
33
|
-
sprite.startY += dy;
|
|
34
|
-
sprite.currentX += dx;
|
|
35
|
-
sprite.currentY += dy;
|
|
36
|
-
sprite.container?.position?.set(sprite.currentX, sprite.currentY);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
25
|
const visibleSet = new Set();
|
|
41
26
|
const baseBufferWorld = Math.max(cardWidth, cardHeight) * 4;
|
|
42
27
|
const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;
|
|
@@ -243,14 +228,17 @@ function syncSpritesToViewport(params) {
|
|
|
243
228
|
sprite.animationDelay = Math.random() * 300;
|
|
244
229
|
}
|
|
245
230
|
}
|
|
246
|
-
|
|
231
|
+
const targetChanged = sprite.targetX !== position.x || sprite.targetY !== position.y;
|
|
232
|
+
if (targetChanged) {
|
|
247
233
|
if (isViewTransition) {
|
|
248
|
-
sprite.
|
|
249
|
-
|
|
234
|
+
if (sprite.animationStartTime === undefined) {
|
|
235
|
+
sprite.startX = sprite.currentX;
|
|
236
|
+
sprite.startY = sprite.currentY;
|
|
237
|
+
sprite.animationStartTime = Date.now();
|
|
238
|
+
sprite.animationDelay = Math.random() * 300;
|
|
239
|
+
}
|
|
250
240
|
sprite.targetX = position.x;
|
|
251
241
|
sprite.targetY = position.y;
|
|
252
|
-
sprite.animationStartTime = Date.now();
|
|
253
|
-
sprite.animationDelay = Math.random() * 300;
|
|
254
242
|
}
|
|
255
243
|
else {
|
|
256
244
|
sprite.targetX = position.x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.js","sources":["../../../../../PivotViewer/components/pivot/visibility.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport * as PIXI from 'pixi.js';\nimport type { CardSprite } from './constants';\nimport { CARD_GAP } from './constants';\nimport type { LayoutResult } from '../../engine/types';\nimport { destroySprite } from './sprites';\n\nexport interface SyncParams<TItem> {\n root: PIXI.Container | null;\n groupsContainer?: PIXI.Container | null;\n container: HTMLDivElement | null;\n sprites: Map<string | number, CardSprite>;\n layout: LayoutResult;\n visibleIds: Uint32Array;\n items: TItem[];\n cardWidth: number;\n cardHeight: number;\n panX: number;\n panY: number;\n panDeltaX?: number;\n panDeltaY?: number;\n viewportWidth: number;\n viewportHeight: number;\n zoomLevel: number;\n createCardSprite: (id: string | number, x: number, y: number) => CardSprite;\n updateCardContent: (sprite: CardSprite, item: TItem) => void;\n isViewTransition?: boolean;\n viewMode: string;\n prevLayout?: LayoutResult | null;\n prevScrollTop?: number;\n prevScrollLeft?: number;\n}\n\nexport function syncSpritesToViewport<TItem>(params: SyncParams<TItem>) {\n const { root, groupsContainer, container, sprites, layout, visibleIds: _visibleIds, items, cardWidth, cardHeight, panX, panY, panDeltaX, panDeltaY, viewportWidth, viewportHeight, createCardSprite, updateCardContent, zoomLevel, isViewTransition, viewMode, prevLayout, prevScrollTop, prevScrollLeft } = params;\n if (!root || !container) return;\n\n void _visibleIds;\n\n // Use the container's measured client size for the viewport dimensions\n // (in pixels). The passed `viewportWidth`/`viewportHeight` can be stale\n // when the browser/device zoom changes; `clientWidth/clientHeight` are\n // authoritative for the actual visible pixel area.\n const viewportPxWidth = container.clientWidth || viewportWidth;\n const viewportPxHeight = container.clientHeight || viewportHeight;\n\n const contentHeightPx = (layout.totalHeight || 0) * zoomLevel;\n let offsetY = 0;\n\n // If content fits vertically within the viewport, align relative to bottom.\n // The spacer ensures container isn't scrollable in this case (scrollTop=0).\n // The items are at large Y coordinates relative to layout.totalHeight.\n // We want the bottom of the layout (totalHeight) to align with viewport bottom.\n if (viewMode === 'grouped' && contentHeightPx < viewportPxHeight) {\n // Calculate offset in pixels to shift the content down\n offsetY = viewportPxHeight - contentHeightPx;\n }\n\n // Use the container's actual scroll position for positioning, not the passed panX/panY\n // which may be stale (from React state) compared to live DOM scroll values.\n const actualScrollX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);\n const actualScrollY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);\n\n // Apply scaling and position to root container\n if (root) {\n root.scale.set(zoomLevel);\n // Standard position: -scrollX, -scrollY\n // Plus vertical alignment offset if zoomed out\n root.position.set(-actualScrollX, offsetY - actualScrollY);\n }\n \n // Apply synchronization to groups container if present\n if (groupsContainer) {\n groupsContainer.scale.set(zoomLevel);\n groupsContainer.position.set(-actualScrollX, offsetY - actualScrollY);\n }\n\n // `visibleIds` comes from callers but this module iterates `layout.positions`\n\n // Apply pan delta to animating sprites to keep them visually stable during camera jumps\n if (isViewTransition && (panDeltaX || panDeltaY)) {\n const dx = (panDeltaX || 0) / (zoomLevel || 1);\n const dy = (panDeltaY || 0) / (zoomLevel || 1);\n\n for (const sprite of sprites.values()) {\n if (sprite.animationStartTime !== undefined) {\n if (sprite.startX !== undefined) sprite.startX += dx;\n if (sprite.startY !== undefined) sprite.startY += dy;\n sprite.currentX += dx;\n sprite.currentY += dy;\n sprite.container?.position?.set(sprite.currentX, sprite.currentY);\n }\n }\n }\n\n const visibleSet = new Set<string | number>();\n\n // Increase buffer (in world units) to reduce edge cases where rapid\n // scrolling skips sprite creation. Keep buffer in world units and convert\n // DOM pixel measurements into world coordinates below to avoid mixing\n // coordinate spaces which can cause precision drift at browser zooms.\n const baseBufferWorld = Math.max(cardWidth, cardHeight) * 4;\n // Ensure buffer scales with viewport size (in world units) so that when\n // zoomed out we still pre-create enough sprites ahead of the viewport.\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n // The layout positions are in world units; when the root container is scaled\n // (zoomed) the rendered pixel position = position * zoomLevel. The DOM\n // scroll positions (`container.scrollLeft/Top`) are the authoritative pixel\n // camera offsets; prefer them over the passed `panX/panY` to avoid stale\n // values or race conditions between React state and direct DOM updates.\n const effectivePanX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);\n const effectivePanY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);\n\n // Convert pixel-based DOM measurements into world units so we compare like\n // with like. root.position is set using -pixels, so the mapping\n // from DOM scroll (pixels) to world units is: world = pixels / zoomLevel.\n // OffsetY is already in pixels and doesn't need scaling in panWorldY calc\n // because panWorldY is used for viewport buffering/culling, which is relative\n // to the \"camera\" position in world space.\n // The camera world Y = (scrollTop - offsetY) / zoomLevel.\n const effectivePanYWithOffset = effectivePanY - offsetY;\n const panWorldX = effectivePanX * invScale;\n const panWorldY = effectivePanYWithOffset * invScale;\n\n const viewportWorldWidth = viewportPxWidth * invScale;\n const viewportWorldHeight = viewportPxHeight * invScale;\n\n // Ensure bufferWorld is calculated from the actual measured viewport\n // in world units (after converting client pixel dims using invScale).\n // Make buffer adaptive to zoom: when zoomed out (invScale > 1) a small\n // pixel scroll maps to a larger world delta, so increase the buffer.\n // Use the larger of width/height to ensure we buffer enough in both directions.\n const bufferWorld = Math.max(baseBufferWorld * invScale, Math.max(viewportWorldWidth, viewportWorldHeight) * 2.0, baseBufferWorld);\n\n // Do not clamp viewport edges to 0 — allow negative top/left values so the\n // visible window correctly follows the scroll even when the buffer is\n // larger than the current scroll offset.\n const viewportLeftWorld = panWorldX - bufferWorld;\n const viewportRightWorld = panWorldX + viewportWorldWidth + bufferWorld;\n const viewportTopWorld = panWorldY - bufferWorld;\n const viewportBottomWorld = panWorldY + viewportWorldHeight + bufferWorld;\n\n const inViewportIds: (string | number)[] = [];\n // Small tolerance in world units to avoid floating-point edge cases when\n // browser/device zoom or high scroll values produce tiny rounding errors.\n // Scale epsilon with invScale so tolerance grows when zoomed out.\n const worldEpsilon = Math.max(0.5, 0.5 * invScale);\n\n // Iterate layout positions directly to avoid depending on `visibleIds`\n // which may be calculated in a different coordinate space or with\n // different assumptions about zoom. Looping the positions map is\n // deterministic and uses world coordinates directly.\n for (const [id, position] of layout.positions) {\n if (!position) continue;\n const worldX = position.x;\n const worldY = position.y;\n const worldCardW = cardWidth;\n const worldCardH = cardHeight;\n\n if (\n worldX + worldCardW >= viewportLeftWorld - worldEpsilon &&\n worldX <= viewportRightWorld + worldEpsilon &&\n worldY + worldCardH >= viewportTopWorld - worldEpsilon &&\n worldY <= viewportBottomWorld + worldEpsilon\n ) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n\n // During view transitions, if no cards are visible and we're not animating yet,\n // force-add the first few cards from the layout to ensure content appears.\n // This prevents a blank screen when switching modes, especially in packaged builds\n // where scroll stabilization might be delayed.\n if (isViewTransition && inViewportIds.length === 0 && layout.positions.size > 0) {\n let count = 0;\n for (const [id, position] of layout.positions) {\n if (count < 5 && position) { // Add up to 5 cards\n inViewportIds.push(id);\n visibleSet.add(id);\n count++;\n }\n }\n }\n\n // Ensure last rows are present when the user scrolls near the bottom.\n // Compute slot/row information and force-insert IDs from the last few\n // rows to avoid missing tiles due to rounding/precision at zoom levels.\n try {\n const slotHeight = cardHeight + (CARD_GAP || 8);\n const totalRows = Math.ceil((layout.totalHeight || 0) / slotHeight) || 0;\n // Determine how many rows are visible in the viewport (world units),\n // then prefetch a fraction of that adjusted by zoom (invScale).\n const rowsVisible = Math.max(1, Math.ceil(viewportWorldHeight / slotHeight));\n const prefetchMultiplier = 0.75; // fraction of viewport to prefetch\n const prefetchRows = Math.max(2, Math.ceil(rowsVisible * prefetchMultiplier * Math.max(1, invScale)));\n const lastRowThresholdY = Math.max(0, (totalRows - prefetchRows) * slotHeight);\n for (const [id, position] of layout.positions) {\n if (position.y >= lastRowThresholdY) {\n if (!visibleSet.has(id)) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n }\n } catch (e) {\n void e;\n }\n\n // Fallback: if no sprites are calculated as visible (e.g., due to rounding\n // or scroll/zoom race conditions), force a handful of cards into view so\n // the canvas never renders empty at certain zoom levels.\n // When transitioning views, be more aggressive to ensure content appears during the transition\n let injectedFallback = false;\n const fallbackCount = isViewTransition ? 30 : 12;\n if (inViewportIds.length === 0 && layout.positions.size > 0) {\n injectedFallback = true;\n let count = 0;\n for (const [id] of layout.positions) {\n inViewportIds.push(id);\n visibleSet.add(id);\n count++;\n if (count >= fallbackCount) break;\n }\n }\n\n // If we detect a very large discrepancy between created sprites and the\n // computed in-viewport count, that's a signal our culling math may be\n // unstable (especially at non-100% zoom). In that case, skip hiding this\n // frame as a conservative safeguard to avoid mass disappearing tiles.\n // However, disable this safeguard during view transitions to ensure old sprites are cleaned up.\n // EXCEPT: During view transitions, if scroll position hasn't stabilized yet (e.g., switching to grouped\n // mode triggers a scroll-to-bottom), keep all sprites visible to prevent flickering.\n // Check scroll stabilization by comparing current scroll to previous scroll position.\n const currentScrollTop = container.scrollTop || 0;\n const currentScrollLeft = container.scrollLeft || 0;\n const scrollTopDelta = Math.abs(currentScrollTop - (prevScrollTop || currentScrollTop));\n const scrollLeftDelta = Math.abs(currentScrollLeft - (prevScrollLeft || currentScrollLeft));\n const scrollStabilized = scrollTopDelta < 10 && scrollLeftDelta < 10;\n const aggressiveCull = !injectedFallback && (\n (!isViewTransition && sprites.size > Math.max(120, Math.ceil(inViewportIds.length * 1.5))) ||\n (isViewTransition && !scrollStabilized)\n );\n\n for (const [id, sprite] of sprites) {\n if (!visibleSet.has(id)) {\n // If view transition is active, check if this sprite has a valid target in the new layout\n // If so, keep it visible and animate it to the new position (even if off-screen)\n if (isViewTransition && layout.positions.has(id)) {\n const newPos = layout.positions.get(id);\n if (newPos) {\n sprite.targetX = newPos.x;\n sprite.targetY = newPos.y;\n\n // Trigger animation if not already animating\n if (sprite.animationStartTime === undefined) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n // Don't mark as hidden, so it won't be swept\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n continue;\n }\n }\n\n if (aggressiveCull) {\n // Keep sprite visible this frame to avoid visual holes\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n continue;\n }\n\n try {\n if (sprite.container) {\n sprite.container.visible = false;\n }\n (sprite as unknown as { __lastHiddenAt: number }).__lastHiddenAt = Date.now();\n } catch (e) {\n void e;\n }\n } else {\n try {\n if (sprite.container) {\n sprite.container.visible = true;\n }\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n } catch (e) { void e; }\n }\n }\n\n // Sweep: actually destroy sprites that have been hidden longer than threshold\n try {\n const SWEEP_MS = 100; // keep hidden sprites for 100ms before destruction (reduced from 500ms for faster mode transitions)\n const now = Date.now();\n for (const [id, sprite] of sprites) {\n const lastHidden = (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n if (lastHidden && now - lastHidden > SWEEP_MS) {\n try {\n // remove from parent if present\n if (sprite.container && sprite.container.parent) sprite.container.parent.removeChild(sprite.container);\n } catch (e) {\n void e;\n }\n try {\n destroySprite(sprite);\n } catch (e) {\n void e;\n }\n sprites.delete(id);\n }\n }\n } catch (e) {\n void e;\n }\n\n // Limit the number of sprites created per frame to avoid choking the GPU/CPU\n // when scrolling rapidly or zooming out significantly.\n const MAX_SPRITES_PER_FRAME = 50;\n let createdCount = 0;\n\n\n for (const id of inViewportIds) {\n const position = layout.positions.get(id);\n if (!position) {\n continue;\n }\n\n let sprite = sprites.get(id);\n if (!sprite) {\n if (createdCount >= MAX_SPRITES_PER_FRAME) {\n continue;\n }\n createdCount++;\n\n let startX = position.x;\n let startY = position.y;\n let shouldAnimate = false;\n\n // If view transition, try to find old position to fly in from\n if (isViewTransition && prevLayout && prevLayout.positions.has(id)) {\n const oldPos = prevLayout.positions.get(id);\n if (oldPos) {\n startX = oldPos.x;\n startY = oldPos.y;\n\n // If we have a pan delta (camera jump), we need to adjust the start position\n // so that the sprite appears at the same visual location relative to the NEW camera.\n // StartWorld = OldWorld + PanDelta\n if (panDeltaX || panDeltaY) {\n const dx = (panDeltaX || 0) / (zoomLevel || 1);\n const dy = (panDeltaY || 0) / (zoomLevel || 1);\n startX += dx;\n startY += dy;\n }\n\n shouldAnimate = true;\n }\n }\n\n sprite = createCardSprite(id, startX, startY);\n sprites.set(id, sprite);\n if (sprite.container) {\n root.addChild(sprite.container);\n sprite.currentX = startX;\n sprite.currentY = startY;\n // Keep sprite.container positioned in world units; animation/update\n // loop will apply root.scale/position to convert to pixels.\n sprite.container.position.set(startX, startY);\n }\n\n if (shouldAnimate) {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n sprite.startX = startX;\n sprite.startY = startY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n }\n\n // Check if target changed to trigger animation\n if (sprite.targetX !== position.x || sprite.targetY !== position.y) {\n if (isViewTransition) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n sprite.animationStartTime = Date.now();\n // Add random delay for \"organic\" fly effect\n sprite.animationDelay = Math.random() * 300;\n } else {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n }\n }\n\n const item = items[Number(id)];\n if (item) {\n updateCardContent(sprite, item);\n }\n }\n}\n"],"names":[],"mappings":";;;AAmCM,SAAU,qBAAqB,CAAQ,MAAyB,EAAA;IAClE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW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c,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG;YAC/C;iBAAO;AACH,gBAAA,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC;AAC3B,gBAAA,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC;gBAC3B,OAAO,MAAM,CAAC,kBAAkB;gBAChC,OAAO,MAAM,CAAC,cAAc;YAChC;QACJ;QAEA,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,IAAI,EAAE;AACN,YAAA,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;QACnC;IACJ;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"visibility.js","sources":["../../../../../PivotViewer/components/pivot/visibility.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport * as PIXI from 'pixi.js';\nimport type { CardSprite } from './constants';\nimport { CARD_GAP } from './constants';\nimport type { LayoutResult } from '../../engine/types';\nimport { destroySprite } from './sprites';\n\nexport interface SyncParams<TItem> {\n root: PIXI.Container | null;\n groupsContainer?: PIXI.Container | null;\n container: HTMLDivElement | null;\n sprites: Map<string | number, CardSprite>;\n layout: LayoutResult;\n visibleIds: Uint32Array;\n items: TItem[];\n cardWidth: number;\n cardHeight: number;\n panX: number;\n panY: number;\n panDeltaX?: number;\n panDeltaY?: number;\n viewportWidth: number;\n viewportHeight: number;\n zoomLevel: number;\n createCardSprite: (id: string | number, x: number, y: number) => CardSprite;\n updateCardContent: (sprite: CardSprite, item: TItem) => void;\n isViewTransition?: boolean;\n viewMode: string;\n prevLayout?: LayoutResult | null;\n prevScrollTop?: number;\n prevScrollLeft?: number;\n}\n\nexport function syncSpritesToViewport<TItem>(params: SyncParams<TItem>) {\n const { root, groupsContainer, container, sprites, layout, visibleIds: _visibleIds, items, cardWidth, cardHeight, panX, panY, panDeltaX, panDeltaY, viewportWidth, viewportHeight, createCardSprite, updateCardContent, zoomLevel, isViewTransition, viewMode, prevLayout, prevScrollTop, prevScrollLeft } = params;\n if (!root || !container) return;\n\n void _visibleIds;\n\n // Use the container's measured client size for the viewport dimensions\n // (in pixels). The passed `viewportWidth`/`viewportHeight` can be stale\n // when the browser/device zoom changes; `clientWidth/clientHeight` are\n // authoritative for the actual visible pixel area.\n const viewportPxWidth = container.clientWidth || viewportWidth;\n const viewportPxHeight = container.clientHeight || viewportHeight;\n\n const contentHeightPx = (layout.totalHeight || 0) * zoomLevel;\n let offsetY = 0;\n\n // If content fits vertically within the viewport, align relative to bottom.\n // The spacer ensures container isn't scrollable in this case (scrollTop=0).\n // The items are at large Y coordinates relative to layout.totalHeight.\n // We want the bottom of the layout (totalHeight) to align with viewport bottom.\n if (viewMode === 'grouped' && contentHeightPx < viewportPxHeight) {\n // Calculate offset in pixels to shift the content down\n offsetY = viewportPxHeight - contentHeightPx;\n }\n\n // Use the container's actual scroll position for positioning, not the passed panX/panY\n // which may be stale (from React state) compared to live DOM scroll values.\n const actualScrollX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);\n const actualScrollY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);\n\n // Apply scaling and position to root container\n if (root) {\n root.scale.set(zoomLevel);\n // Standard position: -scrollX, -scrollY\n // Plus vertical alignment offset if zoomed out\n root.position.set(-actualScrollX, offsetY - actualScrollY);\n }\n \n // Apply synchronization to groups container if present\n if (groupsContainer) {\n groupsContainer.scale.set(zoomLevel);\n groupsContainer.position.set(-actualScrollX, offsetY - actualScrollY);\n }\n\n // `visibleIds` comes from callers but this module iterates `layout.positions`\n\n // Note: Pan delta compensation is NOT applied during view transitions because:\n // 1. The time-based animation system handles position changes smoothly\n // 2. Applying pan delta during animation interferes with the interpolation\n // 3. The scroll position changes are a natural part of the view mode switch\n // This compensation is only useful for rapid scrolling/panning where sprites\n // need to maintain visual stability, which isn't the case during view transitions.\n\n const visibleSet = new Set<string | number>();\n\n // Increase buffer (in world units) to reduce edge cases where rapid\n // scrolling skips sprite creation. Keep buffer in world units and convert\n // DOM pixel measurements into world coordinates below to avoid mixing\n // coordinate spaces which can cause precision drift at browser zooms.\n const baseBufferWorld = Math.max(cardWidth, cardHeight) * 4;\n // Ensure buffer scales with viewport size (in world units) so that when\n // zoomed out we still pre-create enough sprites ahead of the viewport.\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n // The layout positions are in world units; when the root container is scaled\n // (zoomed) the rendered pixel position = position * zoomLevel. The DOM\n // scroll positions (`container.scrollLeft/Top`) are the authoritative pixel\n // camera offsets; prefer them over the passed `panX/panY` to avoid stale\n // values or race conditions between React state and direct DOM updates.\n const effectivePanX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);\n const effectivePanY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);\n\n // Convert pixel-based DOM measurements into world units so we compare like\n // with like. root.position is set using -pixels, so the mapping\n // from DOM scroll (pixels) to world units is: world = pixels / zoomLevel.\n // OffsetY is already in pixels and doesn't need scaling in panWorldY calc\n // because panWorldY is used for viewport buffering/culling, which is relative\n // to the \"camera\" position in world space.\n // The camera world Y = (scrollTop - offsetY) / zoomLevel.\n const effectivePanYWithOffset = effectivePanY - offsetY;\n const panWorldX = effectivePanX * invScale;\n const panWorldY = effectivePanYWithOffset * invScale;\n\n const viewportWorldWidth = viewportPxWidth * invScale;\n const viewportWorldHeight = viewportPxHeight * invScale;\n\n // Ensure bufferWorld is calculated from the actual measured viewport\n // in world units (after converting client pixel dims using invScale).\n // Make buffer adaptive to zoom: when zoomed out (invScale > 1) a small\n // pixel scroll maps to a larger world delta, so increase the buffer.\n // Use the larger of width/height to ensure we buffer enough in both directions.\n const bufferWorld = Math.max(baseBufferWorld * invScale, Math.max(viewportWorldWidth, viewportWorldHeight) * 2.0, baseBufferWorld);\n\n // Do not clamp viewport edges to 0 — allow negative top/left values so the\n // visible window correctly follows the scroll even when the buffer is\n // larger than the current scroll offset.\n const viewportLeftWorld = panWorldX - bufferWorld;\n const viewportRightWorld = panWorldX + viewportWorldWidth + bufferWorld;\n const viewportTopWorld = panWorldY - bufferWorld;\n const viewportBottomWorld = panWorldY + viewportWorldHeight + bufferWorld;\n\n const inViewportIds: (string | number)[] = [];\n // Small tolerance in world units to avoid floating-point edge cases when\n // browser/device zoom or high scroll values produce tiny rounding errors.\n // Scale epsilon with invScale so tolerance grows when zoomed out.\n const worldEpsilon = Math.max(0.5, 0.5 * invScale);\n\n // Iterate layout positions directly to avoid depending on `visibleIds`\n // which may be calculated in a different coordinate space or with\n // different assumptions about zoom. Looping the positions map is\n // deterministic and uses world coordinates directly.\n for (const [id, position] of layout.positions) {\n if (!position) continue;\n const worldX = position.x;\n const worldY = position.y;\n const worldCardW = cardWidth;\n const worldCardH = cardHeight;\n\n if (\n worldX + worldCardW >= viewportLeftWorld - worldEpsilon &&\n worldX <= viewportRightWorld + worldEpsilon &&\n worldY + worldCardH >= viewportTopWorld - worldEpsilon &&\n worldY <= viewportBottomWorld + worldEpsilon\n ) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n\n // During view transitions, if no cards are visible and we're not animating yet,\n // force-add the first few cards from the layout to ensure content appears.\n // This prevents a blank screen when switching modes, especially in packaged builds\n // where scroll stabilization might be delayed.\n if (isViewTransition && inViewportIds.length === 0 && layout.positions.size > 0) {\n let count = 0;\n for (const [id, position] of layout.positions) {\n if (count < 5 && position) { // Add up to 5 cards\n inViewportIds.push(id);\n visibleSet.add(id);\n count++;\n }\n }\n }\n\n // Ensure last rows are present when the user scrolls near the bottom.\n // Compute slot/row information and force-insert IDs from the last few\n // rows to avoid missing tiles due to rounding/precision at zoom levels.\n try {\n const slotHeight = cardHeight + (CARD_GAP || 8);\n const totalRows = Math.ceil((layout.totalHeight || 0) / slotHeight) || 0;\n // Determine how many rows are visible in the viewport (world units),\n // then prefetch a fraction of that adjusted by zoom (invScale).\n const rowsVisible = Math.max(1, Math.ceil(viewportWorldHeight / slotHeight));\n const prefetchMultiplier = 0.75; // fraction of viewport to prefetch\n const prefetchRows = Math.max(2, Math.ceil(rowsVisible * prefetchMultiplier * Math.max(1, invScale)));\n const lastRowThresholdY = Math.max(0, (totalRows - prefetchRows) * slotHeight);\n for (const [id, position] of layout.positions) {\n if (position.y >= lastRowThresholdY) {\n if (!visibleSet.has(id)) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n }\n } catch (e) {\n void e;\n }\n\n // Fallback: if no sprites are calculated as visible (e.g., due to rounding\n // or scroll/zoom race conditions), force a handful of cards into view so\n // the canvas never renders empty at certain zoom levels.\n // When transitioning views, be more aggressive to ensure content appears during the transition\n let injectedFallback = false;\n const fallbackCount = isViewTransition ? 30 : 12;\n if (inViewportIds.length === 0 && layout.positions.size > 0) {\n injectedFallback = true;\n let count = 0;\n for (const [id] of layout.positions) {\n inViewportIds.push(id);\n visibleSet.add(id);\n count++;\n if (count >= fallbackCount) break;\n }\n }\n\n // If we detect a very large discrepancy between created sprites and the\n // computed in-viewport count, that's a signal our culling math may be\n // unstable (especially at non-100% zoom). In that case, skip hiding this\n // frame as a conservative safeguard to avoid mass disappearing tiles.\n // However, disable this safeguard during view transitions to ensure old sprites are cleaned up.\n // EXCEPT: During view transitions, if scroll position hasn't stabilized yet (e.g., switching to grouped\n // mode triggers a scroll-to-bottom), keep all sprites visible to prevent flickering.\n // Check scroll stabilization by comparing current scroll to previous scroll position.\n const currentScrollTop = container.scrollTop || 0;\n const currentScrollLeft = container.scrollLeft || 0;\n const scrollTopDelta = Math.abs(currentScrollTop - (prevScrollTop || currentScrollTop));\n const scrollLeftDelta = Math.abs(currentScrollLeft - (prevScrollLeft || currentScrollLeft));\n const scrollStabilized = scrollTopDelta < 10 && scrollLeftDelta < 10;\n const aggressiveCull = !injectedFallback && (\n (!isViewTransition && sprites.size > Math.max(120, Math.ceil(inViewportIds.length * 1.5))) ||\n (isViewTransition && !scrollStabilized)\n );\n\n for (const [id, sprite] of sprites) {\n if (!visibleSet.has(id)) {\n // If view transition is active, check if this sprite has a valid target in the new layout\n // If so, keep it visible and animate it to the new position (even if off-screen)\n if (isViewTransition && layout.positions.has(id)) {\n const newPos = layout.positions.get(id);\n if (newPos) {\n sprite.targetX = newPos.x;\n sprite.targetY = newPos.y;\n\n // Trigger animation if not already animating\n if (sprite.animationStartTime === undefined) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n // Don't mark as hidden, so it won't be swept\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n continue;\n }\n }\n\n if (aggressiveCull) {\n // Keep sprite visible this frame to avoid visual holes\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n continue;\n }\n\n try {\n if (sprite.container) {\n sprite.container.visible = false;\n }\n (sprite as unknown as { __lastHiddenAt: number }).__lastHiddenAt = Date.now();\n } catch (e) {\n void e;\n }\n } else {\n try {\n if (sprite.container) {\n sprite.container.visible = true;\n }\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n } catch (e) { void e; }\n }\n }\n\n // Sweep: actually destroy sprites that have been hidden longer than threshold\n try {\n const SWEEP_MS = 100; // keep hidden sprites for 100ms before destruction (reduced from 500ms for faster mode transitions)\n const now = Date.now();\n for (const [id, sprite] of sprites) {\n const lastHidden = (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n if (lastHidden && now - lastHidden > SWEEP_MS) {\n try {\n // remove from parent if present\n if (sprite.container && sprite.container.parent) sprite.container.parent.removeChild(sprite.container);\n } catch (e) {\n void e;\n }\n try {\n destroySprite(sprite);\n } catch (e) {\n void e;\n }\n sprites.delete(id);\n }\n }\n } catch (e) {\n void e;\n }\n\n // Limit the number of sprites created per frame to avoid choking the GPU/CPU\n // when scrolling rapidly or zooming out significantly.\n const MAX_SPRITES_PER_FRAME = 50;\n let createdCount = 0;\n\n\n for (const id of inViewportIds) {\n const position = layout.positions.get(id);\n if (!position) {\n continue;\n }\n\n let sprite = sprites.get(id);\n if (!sprite) {\n if (createdCount >= MAX_SPRITES_PER_FRAME) {\n continue;\n }\n createdCount++;\n\n let startX = position.x;\n let startY = position.y;\n let shouldAnimate = false;\n\n // If view transition, try to find old position to fly in from\n if (isViewTransition && prevLayout && prevLayout.positions.has(id)) {\n const oldPos = prevLayout.positions.get(id);\n if (oldPos) {\n startX = oldPos.x;\n startY = oldPos.y;\n\n // If we have a pan delta (camera jump), we need to adjust the start position\n // so that the sprite appears at the same visual location relative to the NEW camera.\n // StartWorld = OldWorld + PanDelta\n if (panDeltaX || panDeltaY) {\n const dx = (panDeltaX || 0) / (zoomLevel || 1);\n const dy = (panDeltaY || 0) / (zoomLevel || 1);\n startX += dx;\n startY += dy;\n }\n\n shouldAnimate = true;\n }\n }\n\n sprite = createCardSprite(id, startX, startY);\n sprites.set(id, sprite);\n if (sprite.container) {\n root.addChild(sprite.container);\n sprite.currentX = startX;\n sprite.currentY = startY;\n // Keep sprite.container positioned in world units; animation/update\n // loop will apply root.scale/position to convert to pixels.\n sprite.container.position.set(startX, startY);\n }\n\n if (shouldAnimate) {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n sprite.startX = startX;\n sprite.startY = startY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n }\n\n // Check if target changed to trigger animation\n const targetChanged = sprite.targetX !== position.x || sprite.targetY !== position.y;\n if (targetChanged) {\n if (isViewTransition) {\n // Only set up animation if not already animating - don't reset animation\n // when targets change during layout recalculations\n if (sprite.animationStartTime === undefined) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.animationStartTime = Date.now();\n // Add random delay for \"organic\" fly effect\n sprite.animationDelay = Math.random() * 300;\n }\n // Always update target to the new position (animation will smoothly\n // adjust to the new target)\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n } else {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n }\n }\n\n const item = items[Number(id)];\n if (item) {\n updateCardContent(sprite, item);\n }\n }\n}\n"],"names":[],"mappings":";;;AAmCM,SAAU,qBAAqB,CAAQ,MAAyB,EAAA;IAClE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,MAAM;AACnT,IAAA,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS;QAAE;AAQzB,IAAA,MAAM,eAAe,GAAG,SAAS,CAAC,WAAW,IAAI,aAAa;AAC9D,IAAA,MAAM,gBAAgB,GAAG,SAAS,CAAC,YAAY,IAAI,cAAc;IAEjE,MAAM,eAAe,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,IAAI,SAAS;IAC7D,IAAI,OAAO,GAAG,CAAC;IAMf,IAAI,QAAQ,KAAK,SAAS,IAAI,eAAe,GAAG,gBAAgB,EAAE;AAE9D,QAAA,OAAO,GAAG,gBAAgB,GAAG,eAAe;IAChD;IAIA,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,UAAU,KAAK,QAAQ,GAAG,SAAS,CAAC,UAAU,IAAI,IAAI,IAAI,CAAC,CAAC;IACnG,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,SAAS,KAAK,QAAQ,GAAG,SAAS,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,CAAC;I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AAM,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,IAAI,EAAE;AACN,YAAA,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;QACnC;IACJ;AACJ;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
const BASE_CARD_WIDTH = 200;
|
|
2
2
|
const BASE_CARD_HEIGHT = 176;
|
|
3
3
|
const CARDS_PER_COLUMN = 5;
|
|
4
|
-
const GROUP_SPACING = 20;
|
|
5
4
|
const CARD_GAP = 10;
|
|
6
5
|
const CANVAS_PADDING = 20;
|
|
7
6
|
|
|
8
|
-
export { BASE_CARD_HEIGHT, BASE_CARD_WIDTH, CANVAS_PADDING, CARDS_PER_COLUMN, CARD_GAP
|
|
7
|
+
export { BASE_CARD_HEIGHT, BASE_CARD_WIDTH, CANVAS_PADDING, CARDS_PER_COLUMN, CARD_GAP };
|
|
9
8
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../PivotViewer/constants.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nexport const BASE_CARD_WIDTH = 200;\nexport const BASE_CARD_HEIGHT = 176;\nexport const CARDS_PER_COLUMN = 5;\nexport const GROUP_SPACING = 20;\nexport const CARD_GAP = 10;\nexport const CANVAS_PADDING = 20;\n"],"names":[],"mappings":"AAGO,MAAM,eAAe,GAAG;AACxB,MAAM,gBAAgB,GAAG;AACzB,MAAM,gBAAgB,GAAG;
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../PivotViewer/constants.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nexport const BASE_CARD_WIDTH = 200;\nexport const BASE_CARD_HEIGHT = 176;\nexport const CARDS_PER_COLUMN = 5;\nexport const GROUP_SPACING = 20;\nexport const CARD_GAP = 10;\nexport const CANVAS_PADDING = 20;\n"],"names":[],"mappings":"AAGO,MAAM,eAAe,GAAG;AACxB,MAAM,gBAAgB,GAAG;AACzB,MAAM,gBAAgB,GAAG;AAEzB,MAAM,QAAQ,GAAG;AACjB,MAAM,cAAc,GAAG;;;;"}
|
|
@@ -49,7 +49,7 @@ function computeGroupedLayout(grouping, spec, positions) {
|
|
|
49
49
|
const effectiveGroupSpacing = 0;
|
|
50
50
|
const slotWidth = cardWidth + CARD_GAP;
|
|
51
51
|
const slotHeight = cardHeight + CARD_GAP;
|
|
52
|
-
const BOTTOM_MARGIN =
|
|
52
|
+
const BOTTOM_MARGIN = CANVAS_PADDING;
|
|
53
53
|
const COLUMNS_PER_BUCKET = 2;
|
|
54
54
|
const bucketWidth = COLUMNS_PER_BUCKET * slotWidth;
|
|
55
55
|
let groupX = 0;
|