@nshiab/simple-data-analysis-core 2.1.5 → 2.1.7

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 (57) hide show
  1. package/esm/class/SimpleTable.d.ts +254 -27
  2. package/esm/class/SimpleTable.d.ts.map +1 -1
  3. package/esm/class/SimpleTable.js +248 -27
  4. package/esm/helpers/graphRouteResultSchema.d.ts +1 -1
  5. package/esm/helpers/graphRouteResultSchema.d.ts.map +1 -1
  6. package/esm/helpers/graphRouteResultSchema.js +3 -2
  7. package/esm/helpers/graphRouteResultSelect.d.ts +1 -1
  8. package/esm/helpers/graphRouteResultSelect.d.ts.map +1 -1
  9. package/esm/helpers/graphRouteResultSelect.js +4 -1
  10. package/esm/helpers/prepareGraphMetricOptions.d.ts +14 -0
  11. package/esm/helpers/prepareGraphMetricOptions.d.ts.map +1 -0
  12. package/esm/helpers/prepareGraphMetricOptions.js +40 -0
  13. package/esm/helpers/prepareGraphTemporalSql.d.ts +3 -0
  14. package/esm/helpers/prepareGraphTemporalSql.d.ts.map +1 -1
  15. package/esm/helpers/prepareGraphTemporalSql.js +7 -0
  16. package/esm/methods/distances.d.ts +2 -0
  17. package/esm/methods/distances.d.ts.map +1 -1
  18. package/esm/methods/distances.js +98 -6
  19. package/esm/methods/findCycles.d.ts +1 -0
  20. package/esm/methods/findCycles.d.ts.map +1 -1
  21. package/esm/methods/findCycles.js +22 -15
  22. package/esm/methods/paths.d.ts +1 -0
  23. package/esm/methods/paths.d.ts.map +1 -1
  24. package/esm/methods/paths.js +21 -14
  25. package/esm/methods/shortestPath.d.ts +2 -0
  26. package/esm/methods/shortestPath.d.ts.map +1 -1
  27. package/esm/methods/shortestPath.js +125 -20
  28. package/llm.md +284 -58
  29. package/llms.txt +1 -1
  30. package/package.json +1 -1
  31. package/script/class/SimpleTable.d.ts +254 -27
  32. package/script/class/SimpleTable.d.ts.map +1 -1
  33. package/script/class/SimpleTable.js +248 -27
  34. package/script/helpers/graphRouteResultSchema.d.ts +1 -1
  35. package/script/helpers/graphRouteResultSchema.d.ts.map +1 -1
  36. package/script/helpers/graphRouteResultSchema.js +3 -2
  37. package/script/helpers/graphRouteResultSelect.d.ts +1 -1
  38. package/script/helpers/graphRouteResultSelect.d.ts.map +1 -1
  39. package/script/helpers/graphRouteResultSelect.js +4 -1
  40. package/script/helpers/prepareGraphMetricOptions.d.ts +14 -0
  41. package/script/helpers/prepareGraphMetricOptions.d.ts.map +1 -0
  42. package/script/helpers/prepareGraphMetricOptions.js +43 -0
  43. package/script/helpers/prepareGraphTemporalSql.d.ts +3 -0
  44. package/script/helpers/prepareGraphTemporalSql.d.ts.map +1 -1
  45. package/script/helpers/prepareGraphTemporalSql.js +7 -0
  46. package/script/methods/distances.d.ts +2 -0
  47. package/script/methods/distances.d.ts.map +1 -1
  48. package/script/methods/distances.js +98 -6
  49. package/script/methods/findCycles.d.ts +1 -0
  50. package/script/methods/findCycles.d.ts.map +1 -1
  51. package/script/methods/findCycles.js +22 -15
  52. package/script/methods/paths.d.ts +1 -0
  53. package/script/methods/paths.d.ts.map +1 -1
  54. package/script/methods/paths.js +21 -14
  55. package/script/methods/shortestPath.d.ts +2 -0
  56. package/script/methods/shortestPath.d.ts.map +1 -1
  57. package/script/methods/shortestPath.js +125 -20
@@ -2770,26 +2770,23 @@ class SimpleTable extends Simple {
2770
2770
  return topologicalSort(this, sourceColumn, targetColumn, options);
2771
2771
  }
2772
2772
  /**
2773
- * Finds the shortest distance from each starting node to every node it can
2774
- * reach by following one or more connections. By default, distance is the
2775
- * number of connections along the shortest route. Use the `weight` option
2776
- * to find the smallest sum of values from a numeric column, such as travel
2777
- * time.
2773
+ * Finds the shortest routes from each starting node to every reachable
2774
+ * node and reports their total costs. By default, each connection costs
2775
+ * one. Use the `weight` option to sum values from a numeric column, such
2776
+ * as travel time or price.
2778
2777
  *
2779
2778
  * The `direction` option lets you follow connections from source to target,
2780
2779
  * from target to source, or in either direction. The result has `start`,
2781
- * `node`, and `distance` columns, sorted by `start`, then by increasing
2782
- * `distance`, then by `node` to break ties. The closest nodes appear first
2783
- * for each start.
2780
+ * `node`, and `total` columns.
2784
2781
  *
2785
- * Each row gives the shortest distance from `start` to `node`. Intermediate
2786
- * steps along the route are not returned. To get the steps between two
2787
- * different nodes, use `shortestPath()` for the shortest routes or `paths()`
2788
- * for all routes without repeated nodes.
2782
+ * Each row gives the selected route's total cost from `start` to `node`.
2783
+ * Intermediate steps along the route are not returned. To get the steps
2784
+ * between two different nodes, use `shortestPath()` for the shortest routes
2785
+ * or `paths()` for all routes without repeated nodes.
2789
2786
  *
2790
2787
  * A starting node appears in its own results only when a self-connection
2791
- * or a route leads back to it. Its distance is the shortest actual return
2792
- * route, using at least one connection. With `direction: "both"`, this
2788
+ * or a route leads back to it. Its total is the cost of the shortest actual
2789
+ * return route, using at least one connection. With `direction: "both"`, this
2793
2790
  * can mean following the same connection out and back.
2794
2791
  *
2795
2792
  * Unknown starting IDs and starts with no connections to follow produce
@@ -2825,12 +2822,12 @@ class SimpleTable extends Simple {
2825
2822
  * .log();
2826
2823
  * ```
2827
2824
  *
2828
- * | start | node | distance |
2825
+ * | start | node | total |
2829
2826
  * | --- | --- | ---: |
2830
2827
  * | A | B | 1 |
2831
2828
  * | A | C | 2 |
2832
2829
  *
2833
- * With `weight: "minutes"`, distance is the shortest total travel time:
2830
+ * With `weight: "minutes"`, `total` is the sum of travel times:
2834
2831
  *
2835
2832
  * @example
2836
2833
  * ```ts
@@ -2839,7 +2836,7 @@ class SimpleTable extends Simple {
2839
2836
  * .log();
2840
2837
  * ```
2841
2838
  *
2842
- * | start | node | distance |
2839
+ * | start | node | total |
2843
2840
  * | --- | --- | ---: |
2844
2841
  * | A | B | 4 |
2845
2842
  * | A | C | 5 |
@@ -2854,7 +2851,7 @@ class SimpleTable extends Simple {
2854
2851
  * .log();
2855
2852
  * ```
2856
2853
  *
2857
- * | start | node | distance |
2854
+ * | start | node | total |
2858
2855
  * | --- | --- | ---: |
2859
2856
  * | C | B | 1 |
2860
2857
  * | C | A | 2 |
@@ -2870,14 +2867,14 @@ class SimpleTable extends Simple {
2870
2867
  * .log();
2871
2868
  * ```
2872
2869
  *
2873
- * | start | node | distance |
2870
+ * | start | node | total |
2874
2871
  * | --- | --- | ---: |
2875
2872
  * | A | B | 1 |
2876
2873
  * | A | A | 2 |
2877
2874
  * | A | C | 2 |
2878
2875
  * | A | D | 2 |
2879
2876
  *
2880
- * A appears at distance 2 because A → B → A follows a connection out
2877
+ * A appears with a total of 2 because A → B → A follows a connection out
2881
2878
  * and back.
2882
2879
  *
2883
2880
  * An array of starting nodes gives separate distances for each start:
@@ -2891,7 +2888,7 @@ class SimpleTable extends Simple {
2891
2888
  * .log();
2892
2889
  * ```
2893
2890
  *
2894
- * | start | node | distance |
2891
+ * | start | node | total |
2895
2892
  * | --- | --- | ---: |
2896
2893
  * | A | B | 4 |
2897
2894
  * | A | C | 5 |
@@ -2917,7 +2914,7 @@ class SimpleTable extends Simple {
2917
2914
  * .log();
2918
2915
  * ```
2919
2916
  *
2920
- * | start | node | distance |
2917
+ * | start | node | total |
2921
2918
  * | --- | --- | ---: |
2922
2919
  * | A | B | 2 |
2923
2920
  * | A | A | 5 |
@@ -2944,11 +2941,68 @@ class SimpleTable extends Simple {
2944
2941
  * .log();
2945
2942
  * ```
2946
2943
  *
2947
- * | start | node | distance |
2944
+ * | start | node | total |
2948
2945
  * | --- | --- | ---: |
2949
2946
  * | A | B | 2 |
2950
2947
  * | A | D | 5 |
2951
2948
  *
2949
+ * For the next two examples, `flights` contains these rows, with departure
2950
+ * and arrival stored as timestamps on the same day:
2951
+ *
2952
+ * | flightId | origin | destination | departure | arrival | price |
2953
+ * | --- | --- | --- | --- | --- | ---: |
2954
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
2955
+ * | F2 | B | C | 2025-01-01 12:00 | 2025-01-01 13:00 | 40 |
2956
+ * | F3 | A | C | 2025-01-01 09:00 | 2025-01-01 12:00 | 120 |
2957
+ *
2958
+ * Find the fastest journey from A to each reachable destination, including
2959
+ * layovers:
2960
+ *
2961
+ * @example
2962
+ * ```ts
2963
+ * await flights
2964
+ * .distances("origin", "destination", "A", {
2965
+ * startTimeColumn: "departure",
2966
+ * endTimeColumn: "arrival",
2967
+ * minGapMs: 60 * 60 * 1000,
2968
+ * elapsedTime: true,
2969
+ * })
2970
+ * .log();
2971
+ * ```
2972
+ *
2973
+ * | start | node | total | elapsedTimeMs |
2974
+ * | --- | --- | ---: | ---: |
2975
+ * | A | B | 1 | 3600000 |
2976
+ * | A | C | 1 | 10800000 |
2977
+ *
2978
+ * The direct flight to C takes three hours (10,800,000 milliseconds).
2979
+ * The route through B takes four hours including its layover.
2980
+ *
2981
+ * Find the fastest journeys from A while also adding up their prices:
2982
+ *
2983
+ * @example
2984
+ * ```ts
2985
+ * await flights
2986
+ * .distances("origin", "destination", "A", {
2987
+ * startTimeColumn: "departure",
2988
+ * endTimeColumn: "arrival",
2989
+ * minGapMs: 60 * 60 * 1000,
2990
+ * elapsedTime: true,
2991
+ * weight: "price",
2992
+ * minimize: "elapsedTime",
2993
+ * })
2994
+ * .log();
2995
+ * ```
2996
+ *
2997
+ * | start | node | total | elapsedTimeMs |
2998
+ * | --- | --- | ---: | ---: |
2999
+ * | A | B | 40 | 3600000 |
3000
+ * | A | C | 120 | 10800000 |
3001
+ *
3002
+ * Use `minimize: "weight"` to find the cheapest journeys instead.
3003
+ * Equally fast journeys are ranked by price; equally cheap journeys
3004
+ * are ranked by elapsed time.
3005
+ *
2952
3006
  * @param sourceColumn - The name of the column containing each connection's source node ID.
2953
3007
  * @param targetColumn - The name of the column containing each connection's target node ID.
2954
3008
  * @param startNodes - One starting node ID or an array of distinct starting node IDs.
@@ -2959,6 +3013,8 @@ class SimpleTable extends Simple {
2959
3013
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
2960
3014
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
2961
3015
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3016
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3017
+ * @param options.minimize - The metric used to select optimal routes. Required when both `weight` and `elapsedTime` are enabled; otherwise inferred. The corresponding metric must be enabled.
2962
3018
  * @param options.outputTable - If `true`, stores the result in a new table with a generated name. If a string, uses it as the new table's name. If `false` or omitted, overwrites the current table. Defaults to `false`.
2963
3019
  * @returns The result table, so methods can be chained.
2964
3020
  * @category Graph Operations
@@ -3156,6 +3212,63 @@ class SimpleTable extends Simple {
3156
3212
  * | ---: | ---: | ---: | ---: | --- | --- | --- |
3157
3213
  * | 0 | 1 | 1 | 1 | F1 | A | B |
3158
3214
  *
3215
+ * For the next two examples, `flights` contains these rows, with departure
3216
+ * and arrival stored as timestamps on the same day:
3217
+ *
3218
+ * | flightId | origin | destination | departure | arrival | price |
3219
+ * | --- | --- | --- | --- | --- | ---: |
3220
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
3221
+ * | F2 | B | C | 2025-01-01 12:00 | 2025-01-01 13:00 | 40 |
3222
+ * | F3 | A | C | 2025-01-01 09:00 | 2025-01-01 12:00 | 120 |
3223
+ * | F4 | A | D | 2025-01-01 09:00 | 2025-01-01 09:30 | 60 |
3224
+ * | F5 | D | C | 2025-01-01 10:30 | 2025-01-01 11:00 | 80 |
3225
+ *
3226
+ * Find the fastest journey from A to C, including layovers:
3227
+ *
3228
+ * @example
3229
+ * ```ts
3230
+ * await flights
3231
+ * .shortestPath("origin", "destination", "flightId", "A", "C", {
3232
+ * startTimeColumn: "departure",
3233
+ * endTimeColumn: "arrival",
3234
+ * minGapMs: 60 * 60 * 1000,
3235
+ * elapsedTime: true,
3236
+ * })
3237
+ * .log();
3238
+ * ```
3239
+ *
3240
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3241
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3242
+ * | 0 | 1 | 1 | 1 | 1800000 | F4 | A | D | 2025-01-01 09:00:00 | 2025-01-01 09:30:00 | 60 |
3243
+ * | 0 | 2 | 1 | 2 | 7200000 | F5 | D | C | 2025-01-01 10:30:00 | 2025-01-01 11:00:00 | 80 |
3244
+ *
3245
+ * The route through D takes two hours (7,200,000 milliseconds), including
3246
+ * a one-hour layover. The direct flight takes three hours.
3247
+ *
3248
+ * Find the fastest journey while also adding up its price:
3249
+ *
3250
+ * @example
3251
+ * ```ts
3252
+ * await flights
3253
+ * .shortestPath("origin", "destination", "flightId", "A", "C", {
3254
+ * startTimeColumn: "departure",
3255
+ * endTimeColumn: "arrival",
3256
+ * minGapMs: 60 * 60 * 1000,
3257
+ * elapsedTime: true,
3258
+ * weight: "price",
3259
+ * minimize: "elapsedTime",
3260
+ * })
3261
+ * .log();
3262
+ * ```
3263
+ *
3264
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3265
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3266
+ * | 0 | 1 | 60 | 60 | 1800000 | F4 | A | D | 2025-01-01 09:00:00 | 2025-01-01 09:30:00 | 60 |
3267
+ * | 0 | 2 | 80 | 140 | 7200000 | F5 | D | C | 2025-01-01 10:30:00 | 2025-01-01 11:00:00 | 80 |
3268
+ *
3269
+ * Use `minimize: "weight"` to find the cheapest journey instead.
3270
+ * All ties on the chosen metric are returned.
3271
+ *
3159
3272
  * @param sourceColumn - The name of the column containing each connection's source node ID.
3160
3273
  * @param targetColumn - The name of the column containing each connection's target node ID.
3161
3274
  * @param edgeId - The name of the column uniquely identifying each connection (edge).
@@ -3168,6 +3281,8 @@ class SimpleTable extends Simple {
3168
3281
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
3169
3282
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
3170
3283
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3284
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3285
+ * @param options.minimize - The metric used to select optimal routes. Required when both `weight` and `elapsedTime` are enabled; otherwise inferred. The corresponding metric must be enabled.
3171
3286
  * @param options.outputTable - If `true`, stores the result in a new table with a generated name. If a string, uses it as the new table's name. If `false` or omitted, overwrites the current table. Defaults to `false`.
3172
3287
  * @returns The result table, so methods can be chained.
3173
3288
  * @category Graph Operations
@@ -3381,6 +3496,59 @@ class SimpleTable extends Simple {
3381
3496
  * | 0 | 1 | 3 | 3 | F3 | B | D | 2025-01-01 11:00:00 | 2025-01-01 12:00:00 | 3 |
3382
3497
  * | 0 | 2 | 2 | 5 | F1 | A | B | 2025-01-01 08:00:00 | 2025-01-01 10:00:00 | 2 |
3383
3498
  *
3499
+ * For the next two examples, `flights` contains these rows, with departure
3500
+ * and arrival stored as timestamps on the same day:
3501
+ *
3502
+ * | flightId | origin | destination | departure | arrival | price |
3503
+ * | --- | --- | --- | --- | --- | ---: |
3504
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
3505
+ * | F2 | B | C | 2025-01-01 12:00 | 2025-01-01 13:00 | 40 |
3506
+ * | F3 | A | C | 2025-01-01 09:00 | 2025-01-01 12:00 | 120 |
3507
+ *
3508
+ * Report elapsed time for every path, including layovers:
3509
+ *
3510
+ * @example
3511
+ * ```ts
3512
+ * await flights
3513
+ * .paths("origin", "destination", "flightId", "A", "C", {
3514
+ * startTimeColumn: "departure",
3515
+ * endTimeColumn: "arrival",
3516
+ * minGapMs: 60 * 60 * 1000,
3517
+ * elapsedTime: true,
3518
+ * })
3519
+ * .log();
3520
+ * ```
3521
+ *
3522
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3523
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3524
+ * | 0 | 1 | 1 | 1 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3525
+ * | 0 | 2 | 1 | 2 | 14400000 | F2 | B | C | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 40 |
3526
+ * | 1 | 1 | 1 | 1 | 10800000 | F3 | A | C | 2025-01-01 09:00:00 | 2025-01-01 12:00:00 | 120 |
3527
+ *
3528
+ * The route through B takes four hours (14,400,000 milliseconds),
3529
+ * including its two-hour layover. The direct flight takes three hours.
3530
+ *
3531
+ * Add up prices while continuing to report elapsed time for every path:
3532
+ *
3533
+ * @example
3534
+ * ```ts
3535
+ * await flights
3536
+ * .paths("origin", "destination", "flightId", "A", "C", {
3537
+ * startTimeColumn: "departure",
3538
+ * endTimeColumn: "arrival",
3539
+ * minGapMs: 60 * 60 * 1000,
3540
+ * elapsedTime: true,
3541
+ * weight: "price",
3542
+ * })
3543
+ * .log();
3544
+ * ```
3545
+ *
3546
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3547
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3548
+ * | 0 | 1 | 40 | 40 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3549
+ * | 0 | 2 | 40 | 80 | 14400000 | F2 | B | C | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 40 |
3550
+ * | 1 | 1 | 120 | 120 | 10800000 | F3 | A | C | 2025-01-01 09:00:00 | 2025-01-01 12:00:00 | 120 |
3551
+ *
3384
3552
  * @param sourceColumn - The name of the column containing each connection's source node ID.
3385
3553
  * @param targetColumn - The name of the column containing each connection's target node ID.
3386
3554
  * @param edgeId - The name of the column uniquely identifying each connection (edge).
@@ -3393,6 +3561,7 @@ class SimpleTable extends Simple {
3393
3561
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
3394
3562
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
3395
3563
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3564
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3396
3565
  * @param options.outputTable - If `true`, stores the result in a new table with a generated name. If a string, uses it as the new table's name. If `false` or omitted, overwrites the current table. Defaults to `false`.
3397
3566
  * @returns The result table, so methods can be chained.
3398
3567
  * @category Graph Operations
@@ -3648,6 +3817,56 @@ class SimpleTable extends Simple {
3648
3817
  * | B | 0 | 2 | 1 | 2 | F2 | C | A | 2025-01-01 10:00:00 |
3649
3818
  * | B | 0 | 3 | 1 | 3 | F1 | B | C | 2025-01-01 09:00:00 |
3650
3819
  *
3820
+ * For the next two examples, `flights` contains these rows, with departure
3821
+ * and arrival stored as timestamps on the same day:
3822
+ *
3823
+ * | flightId | origin | destination | departure | arrival | price |
3824
+ * | --- | --- | --- | --- | --- | ---: |
3825
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
3826
+ * | F2 | B | A | 2025-01-01 12:00 | 2025-01-01 13:00 | 60 |
3827
+ *
3828
+ * Report elapsed time for every cycle, including layovers:
3829
+ *
3830
+ * @example
3831
+ * ```ts
3832
+ * await flights
3833
+ * .findCycles("origin", "destination", "flightId", "A", {
3834
+ * startTimeColumn: "departure",
3835
+ * endTimeColumn: "arrival",
3836
+ * minGapMs: 60 * 60 * 1000,
3837
+ * elapsedTime: true,
3838
+ * })
3839
+ * .log();
3840
+ * ```
3841
+ *
3842
+ * | start | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3843
+ * | --- | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3844
+ * | A | 0 | 1 | 1 | 1 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3845
+ * | A | 0 | 2 | 1 | 2 | 14400000 | F2 | B | A | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 60 |
3846
+ *
3847
+ * The return journey takes four hours (14,400,000 milliseconds),
3848
+ * including the two-hour layover at B.
3849
+ *
3850
+ * Add up prices while continuing to report elapsed time for every cycle:
3851
+ *
3852
+ * @example
3853
+ * ```ts
3854
+ * await flights
3855
+ * .findCycles("origin", "destination", "flightId", "A", {
3856
+ * startTimeColumn: "departure",
3857
+ * endTimeColumn: "arrival",
3858
+ * minGapMs: 60 * 60 * 1000,
3859
+ * elapsedTime: true,
3860
+ * weight: "price",
3861
+ * })
3862
+ * .log();
3863
+ * ```
3864
+ *
3865
+ * | start | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3866
+ * | --- | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3867
+ * | A | 0 | 1 | 40 | 40 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3868
+ * | A | 0 | 2 | 60 | 100 | 14400000 | F2 | B | A | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 60 |
3869
+ *
3651
3870
  * @param sourceColumn - The name of the column containing each connection's source node ID.
3652
3871
  * @param targetColumn - The name of the column containing each connection's target node ID.
3653
3872
  * @param edgeId - The name of the column uniquely identifying each connection (edge).
@@ -3659,6 +3878,7 @@ class SimpleTable extends Simple {
3659
3878
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
3660
3879
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
3661
3880
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3881
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3662
3882
  * @param options.outputTable - If `true`, stores the result in a new table with a generated name. If a string, uses it as the new table's name. If `false` or omitted, overwrites the current table. Defaults to `false`.
3663
3883
  * @returns The result table, so methods can be chained.
3664
3884
  * @category Graph Operations
@@ -7096,23 +7316,24 @@ class SimpleTable extends Simple {
7096
7316
  * @example
7097
7317
  * ```ts
7098
7318
  * // Get GeoJSON data from a specific geometry column named 'myGeometries'
7099
- * const myGeomJson = await table.getGeoData("myGeometries");
7319
+ * const myGeomJson = await table.getGeoData({ column: "myGeometries" });
7100
7320
  * console.log(myGeomJson);
7101
7321
  * ```
7102
7322
  *
7103
7323
  * @example
7104
7324
  * ```ts
7105
7325
  * // Get GeoJSON data and rewind polygon coordinates for D3.js compatibility
7106
- * const rewoundGeojson = await table.getGeoData(undefined, { rewind: true });
7326
+ * const rewoundGeojson = await table.getGeoData({ rewind: true });
7107
7327
  * console.log(rewoundGeojson);
7108
7328
  * ```
7109
- * @param column - The name of the column storing the geometries. If omitted, the method will automatically attempt to find a geometry column.
7110
7329
  * @param options - An optional object with configuration options:
7330
+ * @param options.column - The name of the column storing the geometries. If omitted, the table must have exactly one geometry column, which will be selected automatically.
7111
7331
  * @param options.rewind - If `true`, rewinds the coordinates of polygons to follow the spherical winding order (important for D3.js). Defaults to `false`.
7112
7332
  * @returns A promise that resolves to a GeoJSON object representing the table's geospatial data.
7113
7333
  * @category Getting Data
7114
7334
  */
7115
- async getGeoData(column, options = {}) {
7335
+ async getGeoData(options = {}) {
7336
+ let column = options.column;
7116
7337
  if (column === undefined) {
7117
7338
  column = await findGeoColumn(this, "getGeoData()");
7118
7339
  }
@@ -1,4 +1,4 @@
1
1
  import type { TableSchema } from "./pendingOps.js";
2
2
  /** Derives the route result schema while preserving input columns and types. */
3
- export default function graphRouteResultSchema(schema: TableSchema, distanceType: string, method: string): TableSchema;
3
+ export default function graphRouteResultSchema(schema: TableSchema, distanceType: string, method: string, elapsedTime?: boolean): TableSchema;
4
4
  //# sourceMappingURL=graphRouteResultSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphRouteResultSchema.d.ts","sourceRoot":"","sources":["../../src/helpers/graphRouteResultSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,gFAAgF;AAChF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,WAAW,CASb"}
1
+ {"version":3,"file":"graphRouteResultSchema.d.ts","sourceRoot":"","sources":["../../src/helpers/graphRouteResultSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,gFAAgF;AAChF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,WAAW,UAAQ,GAClB,WAAW,CAcb"}
@@ -1,12 +1,13 @@
1
1
  import validateGraphRouteResultSchema from "./validateGraphRouteResultSchema.js";
2
2
  /** Derives the route result schema while preserving input columns and types. */
3
- export default function graphRouteResultSchema(schema, distanceType, method) {
4
- validateGraphRouteResultSchema(schema, method);
3
+ export default function graphRouteResultSchema(schema, distanceType, method, elapsedTime = false) {
4
+ validateGraphRouteResultSchema(schema, method, elapsedTime ? ["elapsedTimeMs"] : []);
5
5
  return {
6
6
  pathId: "BIGINT",
7
7
  step: "BIGINT",
8
8
  weight: distanceType,
9
9
  total: distanceType,
10
+ ...(elapsedTime ? { elapsedTimeMs: "DOUBLE" } : {}),
10
11
  ...schema,
11
12
  };
12
13
  }
@@ -1,4 +1,4 @@
1
1
  import type { GraphEdgeIdColumn } from "./getGraphEdgeIdColumn.js";
2
2
  /** Joins ranked route steps to their original input rows for final output. */
3
- export default function graphRouteResultSelect(rankedRelation: string, input: string, edgeIdColumn: GraphEdgeIdColumn, includeStart?: boolean): string;
3
+ export default function graphRouteResultSelect(rankedRelation: string, input: string, edgeIdColumn: GraphEdgeIdColumn, includeStart?: boolean, elapsedTime?: boolean): string;
4
4
  //# sourceMappingURL=graphRouteResultSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphRouteResultSelect.d.ts","sourceRoot":"","sources":["../../src/helpers/graphRouteResultSelect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,8EAA8E;AAC9E,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,iBAAiB,EAC/B,YAAY,UAAQ,GACnB,MAAM,CAyBR"}
1
+ {"version":3,"file":"graphRouteResultSelect.d.ts","sourceRoot":"","sources":["../../src/helpers/graphRouteResultSelect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,8EAA8E;AAC9E,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,iBAAiB,EAC/B,YAAY,UAAQ,EACpB,WAAW,UAAQ,GAClB,MAAM,CA8BR"}
@@ -1,6 +1,6 @@
1
1
  import quoteIdentifier from "./quoteIdentifier.js";
2
2
  /** Joins ranked route steps to their original input rows for final output. */
3
- export default function graphRouteResultSelect(rankedRelation, input, edgeIdColumn, includeStart = false) {
3
+ export default function graphRouteResultSelect(rankedRelation, input, edgeIdColumn, includeStart = false, elapsedTime = false) {
4
4
  const q = quoteIdentifier;
5
5
  const routeStep = `${q("unnested")}.${q("route_step")}`;
6
6
  const originalEdgeId = `${q("original")}.${q(edgeIdColumn.column)}`;
@@ -13,6 +13,9 @@ export default function graphRouteResultSelect(rankedRelation, input, edgeIdColu
13
13
  CAST(${q("unnested")}.${q("step")} AS BIGINT) AS ${q("step")},
14
14
  ${routeStep}.${q("weight")} AS ${q("weight")},
15
15
  ${routeStep}.${q("distance")} AS ${q("total")},
16
+ ${elapsedTime
17
+ ? `${routeStep}.${q("elapsedTimeMs")} AS ${q("elapsedTimeMs")},`
18
+ : ""}
16
19
  ${q("original")}.*
17
20
  FROM ${rankedRelation} AS ${q("ranked")},
18
21
  UNNEST(${q("ranked")}.${q("steps")}) WITH ORDINALITY AS ${q("unnested")}(${q("route_step")}, ${q("step")})
@@ -0,0 +1,14 @@
1
+ export type GraphMetricOptions = {
2
+ elapsedTime?: boolean;
3
+ minimize?: "weight" | "elapsedTime";
4
+ weight?: string;
5
+ startTimeColumn?: string;
6
+ endTimeColumn?: string;
7
+ };
8
+ export type PreparedGraphMetricOptions = {
9
+ elapsedTime: boolean;
10
+ minimize: "weight" | "elapsedTime" | "connections";
11
+ };
12
+ /** Resolves graph cost selection separately from optional elapsed-time reporting. */
13
+ export default function prepareGraphMetricOptions(options: GraphMetricOptions, method: string, optimize: boolean): PreparedGraphMetricOptions;
14
+ //# sourceMappingURL=prepareGraphMetricOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareGraphMetricOptions.d.ts","sourceRoot":"","sources":["../../src/helpers/prepareGraphMetricOptions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,QAAQ,GAAG,aAAa,GAAG,aAAa,CAAC;CACpD,CAAC;AAEF,qFAAqF;AACrF,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,GAChB,0BAA0B,CAwD5B"}
@@ -0,0 +1,40 @@
1
+ /** Resolves graph cost selection separately from optional elapsed-time reporting. */
2
+ export default function prepareGraphMetricOptions(options, method, optimize) {
3
+ if (options.elapsedTime !== undefined &&
4
+ typeof options.elapsedTime !== "boolean") {
5
+ throw new TypeError(`${method} options.elapsedTime must be a boolean.`);
6
+ }
7
+ const elapsedTime = options.elapsedTime === true;
8
+ if (elapsedTime &&
9
+ (options.startTimeColumn === undefined ||
10
+ options.endTimeColumn === undefined)) {
11
+ throw new TypeError(`${method} options.elapsedTime requires both options.startTimeColumn and options.endTimeColumn.`);
12
+ }
13
+ if (options.minimize !== undefined) {
14
+ if (!optimize) {
15
+ throw new TypeError(`${method} options.minimize is not supported because this method returns all routes.`);
16
+ }
17
+ if (options.minimize !== "weight" && options.minimize !== "elapsedTime") {
18
+ throw new TypeError(`${method} options.minimize must be "weight" or "elapsedTime".`);
19
+ }
20
+ if (options.minimize === "weight" && options.weight === undefined) {
21
+ throw new TypeError(`${method} options.minimize: "weight" requires options.weight.`);
22
+ }
23
+ if (options.minimize === "elapsedTime" && !elapsedTime) {
24
+ throw new TypeError(`${method} options.minimize: "elapsedTime" requires options.elapsedTime: true.`);
25
+ }
26
+ }
27
+ if (optimize && elapsedTime && options.weight !== undefined &&
28
+ options.minimize === undefined) {
29
+ throw new TypeError(`${method} when weight and elapsedTime are both enabled, specify options.minimize: "weight" or "elapsedTime".`);
30
+ }
31
+ return {
32
+ elapsedTime,
33
+ minimize: options.minimize ??
34
+ (options.weight !== undefined
35
+ ? "weight"
36
+ : elapsedTime
37
+ ? "elapsedTime"
38
+ : "connections"),
39
+ };
40
+ }
@@ -18,6 +18,9 @@ export type PreparedGraphTemporalSql = {
18
18
  eventValidity: (tableAlias?: string) => string;
19
19
  gapParameter: string;
20
20
  gapUnit: "microsecond" | "nanosecond";
21
+ journeyAnchor: (alias: string, direction: Exclude<GraphDirection, "both">) => string;
22
+ journeyElapsed: (alias: string, anchor: string, direction: Exclude<GraphDirection, "both">) => string;
23
+ elapsedMilliseconds: (elapsed: string) => string;
21
24
  startTimeColumn?: string;
22
25
  transition: (currentAlias: string, candidateAlias: string, direction: Exclude<GraphDirection, "both">, gapExpression: string) => string;
23
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"prepareGraphTemporalSql.d.ts","sourceRoot":"","sources":["../../src/helpers/prepareGraphTemporalSql.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACnD,aAAa,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CACV,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,EAC1C,aAAa,EAAE,MAAM,KAClB,MAAM,CAAC;CACb,CAAC;AAWF,0EAA0E;AAC1E,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,cAAc,GAAG,SAAS,EACrC,MAAM,EAAE,MAAM,GACb,4BAA4B,GAAG,SAAS,CAkE1C;AAED,+EAA+E;AAC/E,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,4BAA4B,EACrC,MAAM,EAAE,MAAM,GACb,wBAAwB,CAwE1B"}
1
+ {"version":3,"file":"prepareGraphTemporalSql.d.ts","sourceRoot":"","sources":["../../src/helpers/prepareGraphTemporalSql.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACnD,aAAa,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC;IACtC,aAAa,EAAE,CACb,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,KACvC,MAAM,CAAC;IACZ,cAAc,EAAE,CACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,KACvC,MAAM,CAAC;IACZ,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CACV,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,EAC1C,aAAa,EAAE,MAAM,KAClB,MAAM,CAAC;CACb,CAAC;AAWF,0EAA0E;AAC1E,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,cAAc,GAAG,SAAS,EACrC,MAAM,EAAE,MAAM,GACb,4BAA4B,GAAG,SAAS,CAkE1C;AAED,+EAA+E;AAC/E,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,4BAA4B,EACrC,MAAM,EAAE,MAAM,GACb,wBAAwB,CAgG1B"}
@@ -85,6 +85,13 @@ export default function prepareGraphTemporalSql(schema, options, method) {
85
85
  endTimeColumn: end?.column,
86
86
  gapParameter: gap.toString(),
87
87
  gapUnit,
88
+ journeyAnchor: (alias, direction) => direction === "outgoing"
89
+ ? temporalUnits(eventReference(alias, "__event_start"), startType, gapUnit)
90
+ : temporalUnits(eventReference(alias, "__event_end"), endType, gapUnit),
91
+ journeyElapsed: (alias, anchor, direction) => direction === "outgoing"
92
+ ? `(${temporalUnits(eventReference(alias, "__event_end"), endType, gapUnit)} - (${anchor}))`
93
+ : `((${anchor}) - ${temporalUnits(eventReference(alias, "__event_start"), startType, gapUnit)})`,
94
+ elapsedMilliseconds: (elapsed) => `(CAST(${elapsed} AS DOUBLE) / ${gapUnit === "nanosecond" ? 1000000 : 1000})`,
88
95
  eventSelections: (alias) => [
89
96
  `row_number() OVER () AS ${q("__event_id")}`,
90
97
  `${reference(alias, startColumn)} AS ${q("__event_start")}`,
@@ -6,6 +6,8 @@ type DistancesOptions = GraphTemporalOptions & {
6
6
  direction?: GraphDirection;
7
7
  outputTable?: string | boolean;
8
8
  weight?: string;
9
+ elapsedTime?: boolean;
10
+ minimize?: "weight" | "elapsedTime";
9
11
  };
10
12
  export default function distances(simpleTable: SimpleTable, sourceColumn: string, targetColumn: string, startNodes: GraphId | GraphId[], options?: DistancesOptions): SimpleTable;
11
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"distances.d.ts","sourceRoot":"","sources":["../../src/methods/distances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAIvD,OAAgC,EAC9B,KAAK,oBAAoB,EAG1B,MAAM,uCAAuC,CAAC;AAC/C,OAA2B,EACzB,KAAK,OAAO,EAEb,MAAM,kCAAkC,CAAC;AAC1C,OAA8B,EAC5B,KAAK,cAAc,EAEpB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,gBAAgB,GAAG,oBAAoB,GAAG;IAC7C,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,GAAG,OAAO,EAAE,EAC/B,OAAO,GAAE,gBAAqB,GAC7B,WAAW,CAyGb"}
1
+ {"version":3,"file":"distances.d.ts","sourceRoot":"","sources":["../../src/methods/distances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAOvD,OAAgC,EAC9B,KAAK,oBAAoB,EAG1B,MAAM,uCAAuC,CAAC;AAC/C,OAA2B,EACzB,KAAK,OAAO,EAEb,MAAM,kCAAkC,CAAC;AAC1C,OAA8B,EAC5B,KAAK,cAAc,EAEpB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,gBAAgB,GAAG,oBAAoB,GAAG;IAC7C,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;CACrC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,GAAG,OAAO,EAAE,EAC/B,OAAO,GAAE,gBAAqB,GAC7B,WAAW,CA4Gb"}