@graphty/graphty-element 2.6.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/ai.js +3 -3
  2. package/dist/catalog.js +53 -54
  3. package/dist/chunks/{AiManager-4iQpsJW1.js → AiManager-Bhh0rR_p.js} +706 -655
  4. package/dist/chunks/GraphSession-DPoTaT3b.js +21175 -0
  5. package/dist/chunks/{GraphtyLogger-B_O67a6c.js → GraphtyLogger-BtcBJQPL.js} +1 -1
  6. package/dist/chunks/{VoiceInputAdapter-Cc6mHXTI.js → VoiceInputAdapter-CdLsJ_nG.js} +1 -1
  7. package/dist/chunks/{XRPivotCameraController-BLa89LXn.js → XRPivotCameraController-CiLJ9Gz6.js} +2 -2
  8. package/dist/chunks/algorithms-qij74zEN.js +6811 -0
  9. package/dist/chunks/{capability-check-Am2zliFj.js → capability-check-BbgTejS3.js} +1 -1
  10. package/dist/chunks/definePalette-BYt2Llxs.js +1333 -0
  11. package/dist/chunks/fields-5uVC1Pll.js +4999 -0
  12. package/dist/chunks/{format-detection-BHwrAVzW.js → format-detection-FKaDMshR.js} +1 -1
  13. package/dist/chunks/{index-BkBLbvui.js → index-Cc_6D9hV.js} +6034 -7127
  14. package/dist/chunks/interpolation-Dk206AhZ.js +105 -0
  15. package/dist/chunks/paletteRegistry-De3CGdst.js +357 -0
  16. package/dist/chunks/parse-SVp77JbE.js +669 -0
  17. package/dist/chunks/{pluginRegistry-Bs8bEkz9.js → pluginRegistry-Ddfl6Mv2.js} +27 -24
  18. package/dist/chunks/{registry-BdGvyZou.js → registry-CgMqldp4.js} +1 -1
  19. package/dist/chunks/{DataSource-BL2UzPff.js → sources-BbAJCDIH.js} +279 -108
  20. package/dist/commands.d.ts +128 -19
  21. package/dist/commands.js +49 -1
  22. package/dist/custom-elements.json +1 -1
  23. package/dist/extend.d.ts +10 -2
  24. package/dist/extend.js +64 -57
  25. package/dist/graphty-catalog.json +6 -3
  26. package/dist/graphty.bundle.js +267177 -240648
  27. package/dist/graphty.js +84 -78
  28. package/dist/index.d.ts +4 -0
  29. package/dist/logging.js +2 -2
  30. package/dist/schema.js +70 -71
  31. package/dist/session.d.ts +5 -6
  32. package/dist/session.js +40 -86
  33. package/dist/src/Edge.d.ts +31 -67
  34. package/dist/src/Graph.d.ts +335 -77
  35. package/dist/src/Node.d.ts +36 -3
  36. package/dist/src/NodeBehavior.d.ts +28 -0
  37. package/dist/src/Styles.d.ts +15 -4
  38. package/dist/src/acceleration/AccelerationController.d.ts +8 -0
  39. package/dist/src/acceleration/narrow.d.ts +9 -1
  40. package/dist/src/acceleration/types.d.ts +10 -0
  41. package/dist/src/ai/AiController.d.ts +12 -0
  42. package/dist/src/ai/AiManager.d.ts +7 -0
  43. package/dist/src/ai/commands/AlgorithmCommands.d.ts +1 -1
  44. package/dist/src/ai/commands/LayoutCommands.d.ts +1 -1
  45. package/dist/src/ai/commands/StyleCommands.d.ts +1 -1
  46. package/dist/src/ai/commands/types.d.ts +20 -1
  47. package/dist/src/algorithms/Algorithm.d.ts +21 -4
  48. package/dist/src/algorithms/BFSAlgorithm.d.ts +0 -9
  49. package/dist/src/algorithms/BellmanFordAlgorithm.d.ts +0 -14
  50. package/dist/src/algorithms/DFSAlgorithm.d.ts +1 -1
  51. package/dist/src/algorithms/FloydWarshallAlgorithm.d.ts +5 -0
  52. package/dist/src/algorithms/GirvanNewmanAlgorithm.d.ts +5 -0
  53. package/dist/src/algorithms/LeidenAlgorithm.d.ts +5 -0
  54. package/dist/src/algorithms/PageRankAlgorithm.d.ts +1 -1
  55. package/dist/src/algorithms/StronglyConnectedComponentsAlgorithm.d.ts +1 -1
  56. package/dist/src/algorithms/metrics/fields.d.ts +23 -1
  57. package/dist/src/algorithms/utils/graphUtils.d.ts +13 -1
  58. package/dist/src/catalog/paletteRegistry.d.ts +4 -4
  59. package/dist/src/catalog/registry.d.ts +3 -2
  60. package/dist/src/catalog/types.d.ts +18 -1
  61. package/dist/src/config/GraphStyle.d.ts +1 -1
  62. package/dist/src/config/StyleTemplate.d.ts +2 -2
  63. package/dist/src/config/xr-config-schema.d.ts +4 -4
  64. package/dist/src/data/CSVDataSource.d.ts +77 -22
  65. package/dist/src/data/ErrorAggregator.d.ts +5 -0
  66. package/dist/src/data/GEXFDataSource.d.ts +12 -61
  67. package/dist/src/data/GraphMLDataSource.d.ts +3 -44
  68. package/dist/src/data/GraphStore.d.ts +322 -15
  69. package/dist/src/data/JsonDataSource.d.ts +43 -1
  70. package/dist/src/data/graph-io-import.d.ts +89 -0
  71. package/dist/src/data/graph-io-records.d.ts +64 -0
  72. package/dist/src/data/lane.d.ts +23 -0
  73. package/dist/src/data/positions.d.ts +13 -0
  74. package/dist/src/data/seedPosition.d.ts +16 -0
  75. package/dist/src/errors/GraphtyError.d.ts +3 -1
  76. package/dist/src/errors/codes.d.ts +23 -0
  77. package/dist/src/events.d.ts +12 -0
  78. package/dist/src/graphty-element.d.ts +149 -54
  79. package/dist/src/input/types.d.ts +2 -0
  80. package/dist/src/layout/D3GraphLayoutEngine.d.ts +17 -3
  81. package/dist/src/layout/FixedLayoutEngine.d.ts +20 -4
  82. package/dist/src/layout/KamadaKawaiLayoutEngine.d.ts +6 -0
  83. package/dist/src/layout/LayoutEngine.d.ts +214 -116
  84. package/dist/src/layout/NGraphLayoutEngine.d.ts +10 -3
  85. package/dist/src/layout/SimulationLayoutEngine.d.ts +8 -3
  86. package/dist/src/managers/AlgorithmManager.d.ts +24 -5
  87. package/dist/src/managers/DataManager.d.ts +258 -181
  88. package/dist/src/managers/EventManager.d.ts +5 -2
  89. package/dist/src/managers/GraphContext.d.ts +7 -0
  90. package/dist/src/managers/InputManager.d.ts +11 -0
  91. package/dist/src/managers/LayoutManager.d.ts +129 -50
  92. package/dist/src/managers/RenderManager.d.ts +14 -1
  93. package/dist/src/managers/UpdateManager.d.ts +20 -0
  94. package/dist/src/screenshot/ScreenshotCapture.d.ts +1 -1
  95. package/dist/src/session/GraphSession.d.ts +83 -6
  96. package/dist/src/session/commands/algo.d.ts +169 -0
  97. package/dist/src/session/commands/config.d.ts +45 -0
  98. package/dist/src/session/commands/data.d.ts +178 -0
  99. package/dist/src/session/commands/doors.d.ts +93 -0
  100. package/dist/src/session/commands/index.d.ts +20 -0
  101. package/dist/src/session/commands/layout.d.ts +104 -0
  102. package/dist/src/session/commands/positions.d.ts +30 -0
  103. package/dist/src/session/commands/sets.d.ts +113 -0
  104. package/dist/src/session/commands/style.d.ts +92 -0
  105. package/dist/src/session/commands/view.d.ts +57 -0
  106. package/dist/src/session/commands/visibility.d.ts +41 -0
  107. package/dist/src/session/data.d.ts +131 -4
  108. package/dist/src/session/index.d.ts +1 -1
  109. package/dist/src/session/planning.d.ts +25 -8
  110. package/dist/src/session/project/Dispatcher.d.ts +905 -0
  111. package/dist/src/session/project/History.d.ts +382 -0
  112. package/dist/src/session/project/arrangement.d.ts +247 -0
  113. package/dist/src/session/project/derive.d.ts +132 -0
  114. package/dist/src/session/project/digest.d.ts +33 -0
  115. package/dist/src/session/project/draft.d.ts +194 -0
  116. package/dist/src/session/project/graphOps.d.ts +304 -0
  117. package/dist/src/session/project/ingest.d.ts +364 -0
  118. package/dist/src/session/project/state.d.ts +145 -0
  119. package/dist/src/session/project/strict.d.ts +68 -0
  120. package/dist/src/session/results/RunResult.d.ts +48 -0
  121. package/dist/src/session/results/statistics.d.ts +20 -0
  122. package/dist/src/session/runs/Run.d.ts +80 -4
  123. package/dist/src/session/runs/RunsApi.d.ts +23 -6
  124. package/dist/src/session/runs/types.d.ts +25 -6
  125. package/dist/src/session/scope/ElementMask.d.ts +14 -0
  126. package/dist/src/session/scope/ScopeApi.d.ts +3 -22
  127. package/dist/src/session/scope/spaces.d.ts +29 -0
  128. package/dist/src/session/sealed.d.ts +22 -0
  129. package/dist/src/session/selection/SelectionApi.d.ts +14 -4
  130. package/dist/src/session/sets/SetsApi.d.ts +13 -5
  131. package/dist/src/session/sets/store.d.ts +54 -53
  132. package/dist/src/session/sets/types.d.ts +5 -2
  133. package/dist/src/session/styles/Layer.d.ts +5 -0
  134. package/dist/src/session/styles/StylesApi.d.ts +68 -17
  135. package/dist/src/session/styles/autoApply.d.ts +64 -53
  136. package/dist/src/session/styles/index.d.ts +3 -3
  137. package/dist/src/session/styles/predicate.d.ts +7 -0
  138. package/dist/src/session/styles/repaint.d.ts +16 -1
  139. package/dist/src/session/styles/sources.d.ts +1 -1
  140. package/dist/src/session/types.d.ts +625 -54
  141. package/dist/src/session/visibility/VisibilityApi.d.ts +38 -18
  142. package/dist/src/session/visibility/filter.d.ts +10 -0
  143. package/dist/src/simple/defineAlgorithm.d.ts +28 -0
  144. package/dist/src/simple/defineLayout.d.ts +35 -0
  145. package/dist/src/simple/defineLogDestination.d.ts +31 -0
  146. package/dist/src/simple/definePalette.d.ts +26 -0
  147. package/dist/src/simple/definition.d.ts +106 -0
  148. package/dist/src/simple/options.d.ts +33 -0
  149. package/dist/src/simple/source.d.ts +49 -0
  150. package/dist/src/simple/types.d.ts +366 -0
  151. package/dist/src/simple/view.d.ts +107 -0
  152. package/dist/webgpu.js +2 -2
  153. package/package.json +10 -12
  154. package/dist/chunks/GraphSession-BhuHSXIo.js +0 -12819
  155. package/dist/chunks/GraphStyle-Cwr55SAE.js +0 -65
  156. package/dist/chunks/algorithms-BJ6DQMOe.js +0 -3777
  157. package/dist/chunks/detect-fyuVnlCT.js +0 -88
  158. package/dist/chunks/interpolation-DY-PNpqX.js +0 -43
  159. package/dist/chunks/optionsFromZod-CKMYSwTz.js +0 -3636
  160. package/dist/chunks/paletteRegistry-BCFSwJGK.js +0 -1196
  161. package/dist/chunks/parse-BMTqt4SS.js +0 -3658
  162. package/dist/src/data/csv-variant-detection.d.ts +0 -29
  163. package/dist/src/data/ingest.d.ts +0 -104
package/dist/graphty.js CHANGED
@@ -1,85 +1,91 @@
1
- import { A as s, a as r, b as E, D as O, E as o, d as S, G as R, e as t, I as L, L as _, N as C, O as A, R as N, S as g, f as i, g as n, h as T, U as I, i as p } from "./chunks/index-BkBLbvui.js";
2
- import { L as d, S as G, a as f, r as y } from "./chunks/paletteRegistry-BCFSwJGK.js";
3
- import { D as M, E as P } from "./chunks/DataSource-BL2UzPff.js";
4
- import { T as h, U as m, p as c, q as x, A as u, C as B, x as V, r as H } from "./chunks/optionsFromZod-CKMYSwTz.js";
5
- import { r as Y } from "./chunks/GraphtyLogger-B_O67a6c.js";
6
- import { g as W, b as k, N as w, c as K, P as q, R as v, S as Q, d as X, e as j, f as z } from "./chunks/NodeStyle-CtmA7dXi.js";
7
- import { A as Z, a as $, G as aa, i as ea, b as sa } from "./chunks/pluginRegistry-Bs8bEkz9.js";
8
- import { B as Ea, a as Oa, b as oa, C as Sa, G as Ra, c as ta, I as La, O as _a, d as Ca, e as Aa, f as Na, P as ga, g as ia, h as na, R as Ta, T as Ia, i as pa, V as la, Y as da } from "./chunks/sequential-Zym81qm7.js";
9
- import { a as fa, G as ya, V as Da, i as Ma } from "./chunks/GraphStyle-Cwr55SAE.js";
10
- import { c as Ua } from "./chunks/common-DWNKjpH_.js";
1
+ import { A as r, a as E, b as o, D as O, E as t, d as S, G as R, e as L, I as _, L as C, N as i, O as A, R as n, S as N, f as g, g as I, h as T, U as d, i as f } from "./chunks/index-Cc_6D9hV.js";
2
+ import { ae as p, af as G, y as m, z as y, A as D, X as P, b as c, S as h, c as M, F as U, r as u } from "./chunks/fields-5uVC1Pll.js";
3
+ import { D as B, E as V } from "./chunks/sources-BbAJCDIH.js";
4
+ import "./chunks/GraphSession-DPoTaT3b.js";
5
+ import { r as H } from "./chunks/GraphtyLogger-BtcBJQPL.js";
6
+ import { r as Y } from "./chunks/paletteRegistry-De3CGdst.js";
7
+ import { d as k, a as w, b as K, e as X } from "./chunks/definePalette-BYt2Llxs.js";
8
+ import { g as z, b as Q, N as j, c as q, P as J, R as Z, S as $, d as aa, e as ea, f as sa } from "./chunks/NodeStyle-CtmA7dXi.js";
9
+ import { A as Ea, a as oa, G as Oa, i as ta, b as Sa } from "./chunks/pluginRegistry-Ddfl6Mv2.js";
10
+ import { B as La, a as _a, b as Ca, C as ia, G as Aa, c as na, I as Na, O as ga, d as Ia, e as Ta, f as da, P as fa, g as la, h as pa, R as Ga, T as ma, i as ya, V as Da, Y as Pa } from "./chunks/sequential-Zym81qm7.js";
11
+ import { a as ha, G as Ma, V as Ua, c as ua } from "./chunks/interpolation-Dk206AhZ.js";
12
+ import { c as Ba } from "./chunks/common-DWNKjpH_.js";
11
13
  export {
12
- Z as ACCELERATION_ERROR_CODES,
13
- h as ACCELERATION_MIN_NODES_DEFAULT,
14
- m as ACCELERATION_MIN_NODES_KEY,
15
- c as ACCELERATION_POLICIES,
16
- x as ACCELERATION_POLICY_DEFAULT,
17
- u as Algorithm,
18
- s as AlgorithmManager,
19
- r as AnimationCancelledError,
20
- Ea as BLUES_COLORS,
21
- Oa as BLUE_HIGHLIGHT,
22
- oa as BLUE_ORANGE_COLORS,
23
- E as BUILTIN_PRESETS,
24
- Sa as CARBON_COLORS,
25
- B as CPU_PRECISION,
26
- fa as DEFAULT_VIEW_MODE,
14
+ Ea as ACCELERATION_ERROR_CODES,
15
+ p as ACCELERATION_MIN_NODES_DEFAULT,
16
+ G as ACCELERATION_MIN_NODES_KEY,
17
+ m as ACCELERATION_POLICIES,
18
+ y as ACCELERATION_POLICY_DEFAULT,
19
+ D as Algorithm,
20
+ r as AlgorithmManager,
21
+ E as AnimationCancelledError,
22
+ La as BLUES_COLORS,
23
+ _a as BLUE_HIGHLIGHT,
24
+ Ca as BLUE_ORANGE_COLORS,
25
+ o as BUILTIN_PRESETS,
26
+ ia as CARBON_COLORS,
27
+ P as CPU_PRECISION,
28
+ ha as DEFAULT_VIEW_MODE,
27
29
  O as DataManager,
28
- M as DataSource,
29
- W as EDGE_CONSTANTS,
30
- o as Edge,
31
- k as EdgeStyle,
32
- P as ErrorAggregator,
30
+ B as DataSource,
31
+ z as EDGE_CONSTANTS,
32
+ t as Edge,
33
+ Q as EdgeStyle,
34
+ V as ErrorAggregator,
33
35
  S as EventManager,
34
- $ as GRAPHTY_ERROR_CODES,
35
- Ra as GREENS_COLORS,
36
- ta as GREEN_SUCCESS,
36
+ oa as GRAPHTY_ERROR_CODES,
37
+ Aa as GREENS_COLORS,
38
+ na as GREEN_SUCCESS,
37
39
  R as Graph,
38
- ya as GraphBackground,
39
- t as Graphty,
40
- aa as GraphtyError,
41
- La as INFERNO_COLORS,
42
- L as InputManager,
43
- d as LayoutEngine,
44
- _ as LayoutManager,
45
- C as Node,
46
- w as NodeShapes,
47
- K as NodeStyle,
48
- _a as OKABE_ITO_COLORS,
49
- Ca as ORANGES_COLORS,
50
- Aa as ORANGE_WARNING,
51
- Na as OTHER_GROUP_COLOR,
40
+ Ma as GraphBackground,
41
+ L as Graphty,
42
+ Oa as GraphtyError,
43
+ Na as INFERNO_COLORS,
44
+ _ as InputManager,
45
+ c as LayoutEngine,
46
+ C as LayoutManager,
47
+ i as Node,
48
+ j as NodeShapes,
49
+ q as NodeStyle,
50
+ ga as OKABE_ITO_COLORS,
51
+ Ia as ORANGES_COLORS,
52
+ Ta as ORANGE_WARNING,
53
+ da as OTHER_GROUP_COLOR,
52
54
  A as OperationQueueManager,
53
- ga as PASTEL_COLORS,
54
- ia as PLASMA_COLORS,
55
- na as PURPLE_GREEN_COLORS,
56
- q as PolyhedronType,
57
- Ta as RED_BLUE_COLORS,
58
- N as RenderManager,
59
- v as RichTextStyle,
60
- Q as SHAPE_CONSTANTS,
61
- g as ScreenshotError,
62
- i as ScreenshotErrorCode,
63
- n as SelectionManager,
64
- G as SimpleLayoutConfig,
65
- f as SimpleLayoutEngine,
55
+ fa as PASTEL_COLORS,
56
+ la as PLASMA_COLORS,
57
+ pa as PURPLE_GREEN_COLORS,
58
+ J as PolyhedronType,
59
+ Ga as RED_BLUE_COLORS,
60
+ n as RenderManager,
61
+ Z as RichTextStyle,
62
+ $ as SHAPE_CONSTANTS,
63
+ N as ScreenshotError,
64
+ g as ScreenshotErrorCode,
65
+ I as SelectionManager,
66
+ h as SimpleLayoutConfig,
67
+ M as SimpleLayoutEngine,
66
68
  T as StatsManager,
67
- Ia as TOL_MUTED_COLORS,
68
- pa as TOL_VIBRANT_COLORS,
69
- I as UpdateManager,
70
- Da as VIEW_MODE_VALUES,
71
- la as VIRIDIS_COLORS,
72
- da as YLORBR_COLORS,
73
- Ua as colorToHex,
74
- X as defaultEdgeStyle,
75
- j as defaultNodeStyle,
76
- z as defaultRichTextLabelStyle,
77
- p as defaultXRConfig,
78
- V as isAccelerationPolicy,
79
- ea as isGraphtyError,
80
- sa as isGraphtyErrorCode,
81
- Ma as isViewMode,
82
- H as registerCameraView,
83
- Y as registerLogSink,
84
- y as registerPalette
69
+ ma as TOL_MUTED_COLORS,
70
+ ya as TOL_VIBRANT_COLORS,
71
+ d as UpdateManager,
72
+ Ua as VIEW_MODE_VALUES,
73
+ Da as VIRIDIS_COLORS,
74
+ Pa as YLORBR_COLORS,
75
+ Ba as colorToHex,
76
+ aa as defaultEdgeStyle,
77
+ ea as defaultNodeStyle,
78
+ sa as defaultRichTextLabelStyle,
79
+ f as defaultXRConfig,
80
+ k as defineAlgorithm,
81
+ w as defineLayout,
82
+ K as defineLogDestination,
83
+ X as definePalette,
84
+ U as isAccelerationPolicy,
85
+ ta as isGraphtyError,
86
+ Sa as isGraphtyErrorCode,
87
+ ua as isViewMode,
88
+ u as registerCameraView,
89
+ H as registerLogSink,
90
+ Y as registerPalette
85
91
  };
package/dist/index.d.ts CHANGED
@@ -57,6 +57,10 @@ export { Algorithm } from "./src/algorithms/Algorithm";
57
57
  export { registerCameraView } from "./src/catalog/cameraRegistry";
58
58
  export { registerLogSink } from "./src/catalog/logSinkRegistry";
59
59
  export { registerPalette } from "./src/catalog/paletteRegistry";
60
+ export { defineAlgorithm } from "./src/simple/defineAlgorithm";
61
+ export { defineLayout } from "./src/simple/defineLayout";
62
+ export { defineLogDestination } from "./src/simple/defineLogDestination";
63
+ export { definePalette } from "./src/simple/definePalette";
60
64
  export type { CameraStateChangedEvent, DataLoadingCompleteEvent, DataLoadingErrorEvent, DataLoadingErrorSummaryEvent, DataLoadingProgressEvent, EdgeAddEvent, EdgeEvent, EdgeEventType, EdgeGenericEvent, EventCallbackType, EventType, GraphDataAddedEvent, GraphDataClearedEvent, GraphDataLoadedEvent, GraphErrorEvent, GraphEvent, GraphEventType, GraphGenericEvent, GraphLayoutInitializedEvent, GraphSettledEvent, NodeAddEvent, NodeClickEvent, NodeDragEndEvent, NodeDragStartEvent, NodeEvent, NodeEventDetail, NodeEventType, NodeGenericEvent, NodeHoverEvent, StyleChangedEvent, } from "./src/events";
61
65
  export type { Manager, ManagerConfig, ManagerContext, QueueableManager } from "./src/managers/index";
62
66
  export { AlgorithmManager, DataManager, EventManager, InputManager, LayoutManager, OperationQueueManager, RenderManager, SelectionManager, StatsManager, UpdateManager, } from "./src/managers/index";
package/dist/logging.js CHANGED
@@ -1,5 +1,5 @@
1
- import { d as c, p } from "./chunks/GraphtyLogger-B_O67a6c.js";
2
- import { G, e as C, f as M, g as w, h as N, i as V, j as I, k as P, m as U, n as T, o as x } from "./chunks/GraphtyLogger-B_O67a6c.js";
1
+ import { d as c, p } from "./chunks/GraphtyLogger-BtcBJQPL.js";
2
+ import { G, e as C, f as M, g as w, h as N, i as V, j as I, k as P, m as U, n as T, o as x } from "./chunks/GraphtyLogger-BtcBJQPL.js";
3
3
  const g = "graphty-element-logging-config";
4
4
  function O(t) {
5
5
  try {
package/dist/schema.js CHANGED
@@ -1,21 +1,20 @@
1
- import { R as N, e as x } from "./chunks/types-DFchv4Ny.js";
2
- import { M as h, h as y, i as M } from "./chunks/interpolation-DY-PNpqX.js";
3
- import { B as D, a as U, b as B, C as P, G as H, c as V, I as w, O as $, d as F, e as W, f as Y, P as j, g as k, h as q, R as K, T as v, i as z, V as J, Y as Q } from "./chunks/sequential-Zym81qm7.js";
4
- import { D as Z, a as tt, G as nt, b as at, V as et, i as st } from "./chunks/GraphStyle-Cwr55SAE.js";
5
- import { E as rt, a as ct, b as it, N as Ot, c as St, R as Rt, d as lt, e as ut, f as ft } from "./chunks/NodeStyle-CtmA7dXi.js";
6
- import { c as Lt } from "./chunks/common-DWNKjpH_.js";
1
+ import { R as N, e as A } from "./chunks/types-DFchv4Ny.js";
2
+ import { D as x, a as y, G as M, b as D, M as U, V as m, h as B, i as P, c as H } from "./chunks/interpolation-Dk206AhZ.js";
3
+ import { B as w, a as $, b as F, C as W, G as Y, c as j, I as k, O as q, d as K, e as v, f as z, P as J, g as Q, h as X, R as Z, T as tt, i as nt, V as at, Y as st } from "./chunks/sequential-Zym81qm7.js";
4
+ import { E as ot, a as rt, b as ct, N as it, c as Ot, R as St, d as Rt, e as lt, f as ut } from "./chunks/NodeStyle-CtmA7dXi.js";
5
+ import { c as ft } from "./chunks/common-DWNKjpH_.js";
7
6
  function l(t) {
8
7
  const n = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
9
8
  if (!n)
10
9
  throw new Error(`Invalid hex color: ${t}`);
11
10
  return [parseInt(n[1], 16), parseInt(n[2], 16), parseInt(n[3], 16)];
12
11
  }
13
- function E(t, n, o) {
14
- const s = (a) => {
15
- const e = Math.round(Math.max(0, Math.min(255, a))).toString(16);
16
- return e.length === 1 ? `0${e}` : e;
12
+ function f(t, n, o) {
13
+ const e = (a) => {
14
+ const s = Math.round(Math.max(0, Math.min(255, a))).toString(16);
15
+ return s.length === 1 ? `0${s}` : s;
17
16
  };
18
- return `#${s(t)}${s(n)}${s(o)}`;
17
+ return `#${e(t)}${e(n)}${e(o)}`;
19
18
  }
20
19
  function S(t) {
21
20
  const n = t / 255;
@@ -25,28 +24,28 @@ function R(t) {
25
24
  return t <= 31308e-7 ? t * 12.92 * 255 : (1.055 * Math.pow(t, 1 / 2.4) - 0.055) * 255;
26
25
  }
27
26
  function L(t) {
28
- const [n, o, s] = l(t), a = S(n), e = S(o), r = S(s), O = 0.567 * a + 0.433 * e + 0 * r, c = 0.558 * a + 0.442 * e + 0 * r, i = 0 * a + 0.242 * e + 0.758 * r;
29
- return E(R(O), R(c), R(i));
27
+ const [n, o, e] = l(t), a = S(n), s = S(o), r = S(e), O = 0.567 * a + 0.433 * s + 0 * r, c = 0.558 * a + 0.442 * s + 0 * r, i = 0 * a + 0.242 * s + 0.758 * r;
28
+ return f(R(O), R(c), R(i));
30
29
  }
31
30
  function _(t) {
32
- const [n, o, s] = l(t), a = S(n), e = S(o), r = S(s), O = 0.625 * a + 0.375 * e + 0 * r, c = 0.7 * a + 0.3 * e + 0 * r, i = 0 * a + 0.3 * e + 0.7 * r;
33
- return E(R(O), R(c), R(i));
31
+ const [n, o, e] = l(t), a = S(n), s = S(o), r = S(e), O = 0.625 * a + 0.375 * s + 0 * r, c = 0.7 * a + 0.3 * s + 0 * r, i = 0 * a + 0.3 * s + 0.7 * r;
32
+ return f(R(O), R(c), R(i));
34
33
  }
35
34
  function p(t) {
36
- const [n, o, s] = l(t), a = S(n), e = S(o), r = S(s), O = 0.95 * a + 0.05 * e + 0 * r, c = 0 * a + 0.433 * e + 0.567 * r, i = 0 * a + 0.475 * e + 0.525 * r;
37
- return E(R(O), R(c), R(i));
35
+ const [n, o, e] = l(t), a = S(n), s = S(o), r = S(e), O = 0.95 * a + 0.05 * s + 0 * r, c = 0 * a + 0.433 * s + 0.567 * r, i = 0 * a + 0.475 * s + 0.525 * r;
36
+ return f(R(O), R(c), R(i));
38
37
  }
39
38
  function g(t) {
40
- const [n, o, s] = l(t), a = 0.2126 * n + 0.7152 * o + 0.0722 * s;
41
- return E(a, a, a);
39
+ const [n, o, e] = l(t), a = 0.2126 * n + 0.7152 * o + 0.0722 * e;
40
+ return f(a, a, a);
42
41
  }
43
- function f(t, n) {
44
- const [o, s, a] = l(t), [e, r, O] = l(n), c = o - e, i = s - r, u = a - O;
42
+ function E(t, n) {
43
+ const [o, e, a] = l(t), [s, r, O] = l(n), c = o - s, i = e - r, u = a - O;
45
44
  return Math.sqrt(c * c + i * i + u * u) / 2.55;
46
45
  }
47
46
  function C(t, n, o = 10) {
48
- const s = g(t), a = g(n);
49
- return f(s, a) > o;
47
+ const e = g(t), a = g(n);
48
+ return E(e, a) > o;
50
49
  }
51
50
  function b(t, n = 10) {
52
51
  const o = {
@@ -55,61 +54,61 @@ function b(t, n = 10) {
55
54
  tritanopia: !0,
56
55
  grayscale: !0
57
56
  };
58
- for (let s = 0; s < t.length; s++)
59
- for (let a = s + 1; a < t.length; a++) {
60
- const e = t[s], r = t[a], O = L(e), c = L(r);
61
- f(O, c) < n && (o.protanopia = !1);
62
- const i = _(e), u = _(r);
63
- f(i, u) < n && (o.deuteranopia = !1);
64
- const T = p(e), d = p(r);
65
- f(T, d) < n && (o.tritanopia = !1), C(e, r, n) || (o.grayscale = !1);
57
+ for (let e = 0; e < t.length; e++)
58
+ for (let a = e + 1; a < t.length; a++) {
59
+ const s = t[e], r = t[a], O = L(s), c = L(r);
60
+ E(O, c) < n && (o.protanopia = !1);
61
+ const i = _(s), u = _(r);
62
+ E(i, u) < n && (o.deuteranopia = !1);
63
+ const T = p(s), d = p(r);
64
+ E(T, d) < n && (o.tritanopia = !1), C(s, r, n) || (o.grayscale = !1);
66
65
  }
67
66
  return o;
68
67
  }
69
68
  export {
70
- D as BLUES_COLORS,
71
- U as BLUE_HIGHLIGHT,
72
- B as BLUE_ORANGE_COLORS,
73
- P as CARBON_COLORS,
74
- Z as DEFAULT_SELECTION_STYLE,
75
- tt as DEFAULT_VIEW_MODE,
76
- rt as EdgeArrowTypes,
77
- ct as EdgeLineTypes,
78
- it as EdgeStyle,
79
- H as GREENS_COLORS,
80
- V as GREEN_SUCCESS,
81
- nt as GraphBackground,
82
- at as GraphSelectionStyleOpts,
83
- w as INFERNO_COLORS,
84
- h as MISSING_DATA_COLOR,
85
- Ot as NodeShapes,
86
- St as NodeStyle,
87
- $ as OKABE_ITO_COLORS,
88
- F as ORANGES_COLORS,
89
- W as ORANGE_WARNING,
90
- Y as OTHER_GROUP_COLOR,
91
- j as PASTEL_COLORS,
92
- k as PLASMA_COLORS,
93
- q as PURPLE_GREEN_COLORS,
94
- K as RED_BLUE_COLORS,
69
+ w as BLUES_COLORS,
70
+ $ as BLUE_HIGHLIGHT,
71
+ F as BLUE_ORANGE_COLORS,
72
+ W as CARBON_COLORS,
73
+ x as DEFAULT_SELECTION_STYLE,
74
+ y as DEFAULT_VIEW_MODE,
75
+ ot as EdgeArrowTypes,
76
+ rt as EdgeLineTypes,
77
+ ct as EdgeStyle,
78
+ Y as GREENS_COLORS,
79
+ j as GREEN_SUCCESS,
80
+ M as GraphBackground,
81
+ D as GraphSelectionStyleOpts,
82
+ k as INFERNO_COLORS,
83
+ U as MISSING_DATA_COLOR,
84
+ it as NodeShapes,
85
+ Ot as NodeStyle,
86
+ q as OKABE_ITO_COLORS,
87
+ K as ORANGES_COLORS,
88
+ v as ORANGE_WARNING,
89
+ z as OTHER_GROUP_COLOR,
90
+ J as PASTEL_COLORS,
91
+ Q as PLASMA_COLORS,
92
+ X as PURPLE_GREEN_COLORS,
93
+ Z as RED_BLUE_COLORS,
95
94
  N as RESULT_SHAPES,
96
- Rt as RichTextStyle,
97
- v as TOL_MUTED_COLORS,
98
- z as TOL_VIBRANT_COLORS,
99
- et as VIEW_MODE_VALUES,
100
- J as VIRIDIS_COLORS,
101
- Q as YLORBR_COLORS,
95
+ St as RichTextStyle,
96
+ tt as TOL_MUTED_COLORS,
97
+ nt as TOL_VIBRANT_COLORS,
98
+ m as VIEW_MODE_VALUES,
99
+ at as VIRIDIS_COLORS,
100
+ st as YLORBR_COLORS,
102
101
  C as areDistinguishableInGrayscale,
103
- f as colorDifference,
104
- Lt as colorToHex,
105
- lt as defaultEdgeStyle,
106
- ut as defaultNodeStyle,
107
- ft as defaultRichTextLabelStyle,
108
- y as hexToRgb,
109
- M as interpolatePalette,
102
+ E as colorDifference,
103
+ ft as colorToHex,
104
+ Rt as defaultEdgeStyle,
105
+ lt as defaultNodeStyle,
106
+ ut as defaultRichTextLabelStyle,
107
+ B as hexToRgb,
108
+ P as interpolatePalette,
110
109
  b as isPaletteSafe,
111
- x as isResultShape,
112
- st as isViewMode,
110
+ A as isResultShape,
111
+ H as isViewMode,
113
112
  _ as simulateDeuteranopia,
114
113
  L as simulateProtanopia,
115
114
  p as simulateTritanopia,
package/dist/session.d.ts CHANGED
@@ -56,7 +56,7 @@
56
56
  */
57
57
  import type { RuleTree, SelectionDirection } from "./src/catalog/types";
58
58
  import type { SelectionOp } from "./src/session/selection";
59
- export type { ComponentStatistics, CreateGraphSessionOptions, EdgeRecord, GraphSession, GraphStatistics, NodeRecord, SessionAttributes, SessionCatalogApi, SessionConfig, SessionDataApi, SessionDataConfig, SessionEventMap, SessionGraphStore, SessionRecordSource, SessionRunsOptions, SessionStatus, StyleProblem, } from "./src/session";
59
+ export type { CommandOutcome, CommandOutcomeMap, ComponentStatistics, CreateGraphSessionOptions, DataSourceDescriptor, DataSourceInput, EdgeRecord, EdgeRecordInput, GraphSession, GraphStatistics, HistoryCause, HistoryOutcome, HistoryStep, HistoryStepId, ImportOptions, NodeRecord, NodeRecordInput, PendingId, PendingStep, PositionEntry, ProjectConfig, ProjectConfigPatch, ProjectSlice, RowUpdate, SessionAttributes, SessionCatalogApi, SessionConfig, SessionDataApi, SessionDataConfig, SessionEventMap, SessionGraphStore, SessionHistory, SessionLayout, SessionPositions, SessionRunsOptions, SessionStatus, SessionViews, StyleProblem, TransactionOptions, TransactionScope, } from "./src/session";
60
60
  export { createGraphSession } from "./src/session";
61
61
  /**
62
62
  * What the element has to say about a load, once the load is over: which record keys named the
@@ -70,12 +70,11 @@ export { createGraphSession } from "./src/session";
70
70
  export type { EndpointSpelling } from "./src/data/endpoints";
71
71
  export type { ImportReport, RepeatedEdgeCounts } from "./src/data/report";
72
72
  /**
73
- * The type of `session.positions`, so that a consumer holding one can name it.
74
- *
75
- * The type only, not the constructor: the coordinates belong to the graph the element froze, and
76
- * a second array built beside it would be lent to nothing.
73
+ * The read half of `session.positions` and of `session.data.store.positions`, so that a consumer
74
+ * holding one can name it. Nodes are placed and pinned through `session.positions.set`, `pin` and
75
+ * `unpin`, which are undoable steps.
77
76
  */
78
- export type { ElementPositions } from "./src/data/positions";
77
+ export type { ReadonlyElementPositions } from "./src/session";
79
78
  export type { LayoutRecommendation, LayoutRecommendationOptions } from "./src/session";
80
79
  export { recommendLayout } from "./src/session";
81
80
  export type { BatchResult, BatchStep, Caveats, EngineVersions, Precision, Progress, QueueEntry, QueuePolicy, ResolvedScope, Run, RunChange, RunDirection, RunExecutionContext, RunExecutor, RunOptions, RunOutcome, RunPhase, RunProgressReport, RunQueue, RunRecord, RunRemoval, RunsApi, RunScopeRecord, RunSpec, RunStatus, RunStyle, StaleNote, StartOptions, WeightMeaning, } from "./src/session/runs";
package/dist/session.js CHANGED
@@ -1,88 +1,42 @@
1
- import { L as s } from "./chunks/parse-BMTqt4SS.js";
2
- import { p, a as R } from "./chunks/parse-BMTqt4SS.js";
3
- import { R as c, e as A } from "./chunks/types-DFchv4Ny.js";
4
- import { A as m, a as L, G as g, i as O, b as U } from "./chunks/pluginRegistry-Bs8bEkz9.js";
5
- import { p as P, q as y, R as N, t as D, u as w, w as v, x as G, y as b, z as x } from "./chunks/optionsFromZod-CKMYSwTz.js";
6
- import { D as h } from "./chunks/GraphSession-BhuHSXIo.js";
7
- import { a as z, b as M, c as k, d as H, Q as Y, R as j, e as q, f as Q, S as X, T as B, g as J, i as K, h as V, j as W, k as Z } from "./chunks/GraphSession-BhuHSXIo.js";
8
- const u = [
9
- {
10
- id: "fixed",
11
- fires: ({ statistics: e, placedNodes: a }) => e.nodeCount > 0 && a >= e.nodeCount,
12
- reason: "Every node already carries a coordinate, so this keeps the arrangement the data arrived with instead of computing a new one over the top of it."
13
- },
14
- {
15
- id: "random",
16
- fires: ({ statistics: e, largeGraphThreshold: a }) => e.nodeCount > a,
17
- reason: "This graph is large enough that settling a force simulation would hold the frame for a long time, so it is scattered from a seed instead: instant, and the same every time."
18
- },
19
- {
20
- id: "circular",
21
- fires: ({ statistics: e }) => e.nodeCount > 0 && e.edgeCount === 0,
22
- reason: "Nothing is connected, so a force layout has no pull to work with and would push every node equally far from every other. A ring puts them in a readable order instead."
23
- },
24
- {
25
- id: "force",
26
- fires: () => !0,
27
- reason: "Connected nodes are pulled together and unconnected ones pushed apart, which is the arrangement that shows this graph's structure without being told anything about it."
28
- }
29
- ];
30
- function n(e, a) {
31
- return e.structuralInputs.length > 0 ? !1 : e.sizeRating === "any" || a <= e.sizeRating;
32
- }
33
- function T(e, a = {}) {
34
- const i = {
35
- statistics: e,
36
- placedNodes: a.placedNodes ?? 0,
37
- largeGraphThreshold: a.largeGraphThreshold ?? h.largeGraphThreshold
38
- };
39
- for (const r of u) {
40
- if (!r.fires(i))
41
- continue;
42
- const o = s.find((d) => d.id === r.id);
43
- if (o !== void 0 && n(o, e.nodeCount))
44
- return Object.freeze({ layout: o, reason: r.reason });
45
- }
46
- const t = s.find((r) => n(r, e.nodeCount));
47
- return t === void 0 ? void 0 : Object.freeze({
48
- layout: t,
49
- reason: "The first arrangement this element can place a graph of this size with."
50
- });
51
- }
1
+ import { p as E, a as S } from "./chunks/parse-SVp77JbE.js";
2
+ import { R as _, e as r } from "./chunks/types-DFchv4Ny.js";
3
+ import { A as R, a as e, G as o, i as t, b as C } from "./chunks/pluginRegistry-Ddfl6Mv2.js";
4
+ import { y as O, z as i, R as U, B as I, C as P, E as p, F as N, G as D, H as n } from "./chunks/fields-5uVC1Pll.js";
5
+ import { D as u, a as h, b as f, c as F, d as G, Q as c, R as d, e as l, f as y, S as M, T as x, g as H, i as g, h as b, j as Q, k as Y, r as j } from "./chunks/GraphSession-DPoTaT3b.js";
52
6
  export {
53
- m as ACCELERATION_ERROR_CODES,
54
- P as ACCELERATION_POLICIES,
55
- y as ACCELERATION_POLICY_DEFAULT,
56
- z as DEFAULT_COST_GATE_LIMITS,
57
- M as DEFAULT_EXACT_COMPUTATION_CAP_SECONDS,
58
- h as DEFAULT_LIMITS,
59
- k as DEFAULT_SCOPE_SAMPLE,
60
- H as DEFAULT_SELECTION_CAP,
61
- L as GRAPHTY_ERROR_CODES,
62
- g as GraphtyError,
63
- Y as QUEUE_POLICIES,
64
- N as RESULT_FIELD_NAMES,
65
- D as RESULT_ROOT,
66
- c as RESULT_SHAPES,
67
- w as RESULT_SHAPE_CONTRACTS,
68
- j as RUN_ID_PATTERN,
69
- q as RUN_PHASES,
70
- Q as RUN_STATUSES,
71
- X as SET_OPS,
72
- B as TERMINAL_RUN_STATUSES,
73
- J as createGraphSession,
74
- v as defaultReading,
75
- G as isAccelerationPolicy,
76
- K as isAlgorithmRunCommand,
77
- O as isGraphtyError,
78
- U as isGraphtyErrorCode,
79
- A as isResultShape,
80
- V as isRunId,
81
- W as isRunStatus,
82
- Z as isTerminalRunStatus,
83
- p as parseScope,
84
- R as parseSetDefinition,
85
- b as quotePath,
86
- T as recommendLayout,
87
- x as resultPath
7
+ R as ACCELERATION_ERROR_CODES,
8
+ O as ACCELERATION_POLICIES,
9
+ i as ACCELERATION_POLICY_DEFAULT,
10
+ u as DEFAULT_COST_GATE_LIMITS,
11
+ h as DEFAULT_EXACT_COMPUTATION_CAP_SECONDS,
12
+ f as DEFAULT_LIMITS,
13
+ F as DEFAULT_SCOPE_SAMPLE,
14
+ G as DEFAULT_SELECTION_CAP,
15
+ e as GRAPHTY_ERROR_CODES,
16
+ o as GraphtyError,
17
+ c as QUEUE_POLICIES,
18
+ U as RESULT_FIELD_NAMES,
19
+ I as RESULT_ROOT,
20
+ _ as RESULT_SHAPES,
21
+ P as RESULT_SHAPE_CONTRACTS,
22
+ d as RUN_ID_PATTERN,
23
+ l as RUN_PHASES,
24
+ y as RUN_STATUSES,
25
+ M as SET_OPS,
26
+ x as TERMINAL_RUN_STATUSES,
27
+ H as createGraphSession,
28
+ p as defaultReading,
29
+ N as isAccelerationPolicy,
30
+ g as isAlgorithmRunCommand,
31
+ t as isGraphtyError,
32
+ C as isGraphtyErrorCode,
33
+ r as isResultShape,
34
+ b as isRunId,
35
+ Q as isRunStatus,
36
+ Y as isTerminalRunStatus,
37
+ E as parseScope,
38
+ S as parseSetDefinition,
39
+ D as quotePath,
40
+ j as recommendLayout,
41
+ n as resultPath
88
42
  };