@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
@@ -2775,26 +2775,23 @@ class SimpleTable extends Simple_js_1.default {
2775
2775
  return (0, topologicalSort_js_1.default)(this, sourceColumn, targetColumn, options);
2776
2776
  }
2777
2777
  /**
2778
- * Finds the shortest distance from each starting node to every node it can
2779
- * reach by following one or more connections. By default, distance is the
2780
- * number of connections along the shortest route. Use the `weight` option
2781
- * to find the smallest sum of values from a numeric column, such as travel
2782
- * time.
2778
+ * Finds the shortest routes from each starting node to every reachable
2779
+ * node and reports their total costs. By default, each connection costs
2780
+ * one. Use the `weight` option to sum values from a numeric column, such
2781
+ * as travel time or price.
2783
2782
  *
2784
2783
  * The `direction` option lets you follow connections from source to target,
2785
2784
  * from target to source, or in either direction. The result has `start`,
2786
- * `node`, and `distance` columns, sorted by `start`, then by increasing
2787
- * `distance`, then by `node` to break ties. The closest nodes appear first
2788
- * for each start.
2785
+ * `node`, and `total` columns.
2789
2786
  *
2790
- * Each row gives the shortest distance from `start` to `node`. Intermediate
2791
- * steps along the route are not returned. To get the steps between two
2792
- * different nodes, use `shortestPath()` for the shortest routes or `paths()`
2793
- * for all routes without repeated nodes.
2787
+ * Each row gives the selected route's total cost from `start` to `node`.
2788
+ * Intermediate steps along the route are not returned. To get the steps
2789
+ * between two different nodes, use `shortestPath()` for the shortest routes
2790
+ * or `paths()` for all routes without repeated nodes.
2794
2791
  *
2795
2792
  * A starting node appears in its own results only when a self-connection
2796
- * or a route leads back to it. Its distance is the shortest actual return
2797
- * route, using at least one connection. With `direction: "both"`, this
2793
+ * or a route leads back to it. Its total is the cost of the shortest actual
2794
+ * return route, using at least one connection. With `direction: "both"`, this
2798
2795
  * can mean following the same connection out and back.
2799
2796
  *
2800
2797
  * Unknown starting IDs and starts with no connections to follow produce
@@ -2830,12 +2827,12 @@ class SimpleTable extends Simple_js_1.default {
2830
2827
  * .log();
2831
2828
  * ```
2832
2829
  *
2833
- * | start | node | distance |
2830
+ * | start | node | total |
2834
2831
  * | --- | --- | ---: |
2835
2832
  * | A | B | 1 |
2836
2833
  * | A | C | 2 |
2837
2834
  *
2838
- * With `weight: "minutes"`, distance is the shortest total travel time:
2835
+ * With `weight: "minutes"`, `total` is the sum of travel times:
2839
2836
  *
2840
2837
  * @example
2841
2838
  * ```ts
@@ -2844,7 +2841,7 @@ class SimpleTable extends Simple_js_1.default {
2844
2841
  * .log();
2845
2842
  * ```
2846
2843
  *
2847
- * | start | node | distance |
2844
+ * | start | node | total |
2848
2845
  * | --- | --- | ---: |
2849
2846
  * | A | B | 4 |
2850
2847
  * | A | C | 5 |
@@ -2859,7 +2856,7 @@ class SimpleTable extends Simple_js_1.default {
2859
2856
  * .log();
2860
2857
  * ```
2861
2858
  *
2862
- * | start | node | distance |
2859
+ * | start | node | total |
2863
2860
  * | --- | --- | ---: |
2864
2861
  * | C | B | 1 |
2865
2862
  * | C | A | 2 |
@@ -2875,14 +2872,14 @@ class SimpleTable extends Simple_js_1.default {
2875
2872
  * .log();
2876
2873
  * ```
2877
2874
  *
2878
- * | start | node | distance |
2875
+ * | start | node | total |
2879
2876
  * | --- | --- | ---: |
2880
2877
  * | A | B | 1 |
2881
2878
  * | A | A | 2 |
2882
2879
  * | A | C | 2 |
2883
2880
  * | A | D | 2 |
2884
2881
  *
2885
- * A appears at distance 2 because A → B → A follows a connection out
2882
+ * A appears with a total of 2 because A → B → A follows a connection out
2886
2883
  * and back.
2887
2884
  *
2888
2885
  * An array of starting nodes gives separate distances for each start:
@@ -2896,7 +2893,7 @@ class SimpleTable extends Simple_js_1.default {
2896
2893
  * .log();
2897
2894
  * ```
2898
2895
  *
2899
- * | start | node | distance |
2896
+ * | start | node | total |
2900
2897
  * | --- | --- | ---: |
2901
2898
  * | A | B | 4 |
2902
2899
  * | A | C | 5 |
@@ -2922,7 +2919,7 @@ class SimpleTable extends Simple_js_1.default {
2922
2919
  * .log();
2923
2920
  * ```
2924
2921
  *
2925
- * | start | node | distance |
2922
+ * | start | node | total |
2926
2923
  * | --- | --- | ---: |
2927
2924
  * | A | B | 2 |
2928
2925
  * | A | A | 5 |
@@ -2949,11 +2946,68 @@ class SimpleTable extends Simple_js_1.default {
2949
2946
  * .log();
2950
2947
  * ```
2951
2948
  *
2952
- * | start | node | distance |
2949
+ * | start | node | total |
2953
2950
  * | --- | --- | ---: |
2954
2951
  * | A | B | 2 |
2955
2952
  * | A | D | 5 |
2956
2953
  *
2954
+ * For the next two examples, `flights` contains these rows, with departure
2955
+ * and arrival stored as timestamps on the same day:
2956
+ *
2957
+ * | flightId | origin | destination | departure | arrival | price |
2958
+ * | --- | --- | --- | --- | --- | ---: |
2959
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
2960
+ * | F2 | B | C | 2025-01-01 12:00 | 2025-01-01 13:00 | 40 |
2961
+ * | F3 | A | C | 2025-01-01 09:00 | 2025-01-01 12:00 | 120 |
2962
+ *
2963
+ * Find the fastest journey from A to each reachable destination, including
2964
+ * layovers:
2965
+ *
2966
+ * @example
2967
+ * ```ts
2968
+ * await flights
2969
+ * .distances("origin", "destination", "A", {
2970
+ * startTimeColumn: "departure",
2971
+ * endTimeColumn: "arrival",
2972
+ * minGapMs: 60 * 60 * 1000,
2973
+ * elapsedTime: true,
2974
+ * })
2975
+ * .log();
2976
+ * ```
2977
+ *
2978
+ * | start | node | total | elapsedTimeMs |
2979
+ * | --- | --- | ---: | ---: |
2980
+ * | A | B | 1 | 3600000 |
2981
+ * | A | C | 1 | 10800000 |
2982
+ *
2983
+ * The direct flight to C takes three hours (10,800,000 milliseconds).
2984
+ * The route through B takes four hours including its layover.
2985
+ *
2986
+ * Find the fastest journeys from A while also adding up their prices:
2987
+ *
2988
+ * @example
2989
+ * ```ts
2990
+ * await flights
2991
+ * .distances("origin", "destination", "A", {
2992
+ * startTimeColumn: "departure",
2993
+ * endTimeColumn: "arrival",
2994
+ * minGapMs: 60 * 60 * 1000,
2995
+ * elapsedTime: true,
2996
+ * weight: "price",
2997
+ * minimize: "elapsedTime",
2998
+ * })
2999
+ * .log();
3000
+ * ```
3001
+ *
3002
+ * | start | node | total | elapsedTimeMs |
3003
+ * | --- | --- | ---: | ---: |
3004
+ * | A | B | 40 | 3600000 |
3005
+ * | A | C | 120 | 10800000 |
3006
+ *
3007
+ * Use `minimize: "weight"` to find the cheapest journeys instead.
3008
+ * Equally fast journeys are ranked by price; equally cheap journeys
3009
+ * are ranked by elapsed time.
3010
+ *
2957
3011
  * @param sourceColumn - The name of the column containing each connection's source node ID.
2958
3012
  * @param targetColumn - The name of the column containing each connection's target node ID.
2959
3013
  * @param startNodes - One starting node ID or an array of distinct starting node IDs.
@@ -2964,6 +3018,8 @@ class SimpleTable extends Simple_js_1.default {
2964
3018
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
2965
3019
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
2966
3020
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3021
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3022
+ * @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.
2967
3023
  * @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`.
2968
3024
  * @returns The result table, so methods can be chained.
2969
3025
  * @category Graph Operations
@@ -3161,6 +3217,63 @@ class SimpleTable extends Simple_js_1.default {
3161
3217
  * | ---: | ---: | ---: | ---: | --- | --- | --- |
3162
3218
  * | 0 | 1 | 1 | 1 | F1 | A | B |
3163
3219
  *
3220
+ * For the next two examples, `flights` contains these rows, with departure
3221
+ * and arrival stored as timestamps on the same day:
3222
+ *
3223
+ * | flightId | origin | destination | departure | arrival | price |
3224
+ * | --- | --- | --- | --- | --- | ---: |
3225
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
3226
+ * | F2 | B | C | 2025-01-01 12:00 | 2025-01-01 13:00 | 40 |
3227
+ * | F3 | A | C | 2025-01-01 09:00 | 2025-01-01 12:00 | 120 |
3228
+ * | F4 | A | D | 2025-01-01 09:00 | 2025-01-01 09:30 | 60 |
3229
+ * | F5 | D | C | 2025-01-01 10:30 | 2025-01-01 11:00 | 80 |
3230
+ *
3231
+ * Find the fastest journey from A to C, including layovers:
3232
+ *
3233
+ * @example
3234
+ * ```ts
3235
+ * await flights
3236
+ * .shortestPath("origin", "destination", "flightId", "A", "C", {
3237
+ * startTimeColumn: "departure",
3238
+ * endTimeColumn: "arrival",
3239
+ * minGapMs: 60 * 60 * 1000,
3240
+ * elapsedTime: true,
3241
+ * })
3242
+ * .log();
3243
+ * ```
3244
+ *
3245
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3246
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3247
+ * | 0 | 1 | 1 | 1 | 1800000 | F4 | A | D | 2025-01-01 09:00:00 | 2025-01-01 09:30:00 | 60 |
3248
+ * | 0 | 2 | 1 | 2 | 7200000 | F5 | D | C | 2025-01-01 10:30:00 | 2025-01-01 11:00:00 | 80 |
3249
+ *
3250
+ * The route through D takes two hours (7,200,000 milliseconds), including
3251
+ * a one-hour layover. The direct flight takes three hours.
3252
+ *
3253
+ * Find the fastest journey while also adding up its price:
3254
+ *
3255
+ * @example
3256
+ * ```ts
3257
+ * await flights
3258
+ * .shortestPath("origin", "destination", "flightId", "A", "C", {
3259
+ * startTimeColumn: "departure",
3260
+ * endTimeColumn: "arrival",
3261
+ * minGapMs: 60 * 60 * 1000,
3262
+ * elapsedTime: true,
3263
+ * weight: "price",
3264
+ * minimize: "elapsedTime",
3265
+ * })
3266
+ * .log();
3267
+ * ```
3268
+ *
3269
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3270
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3271
+ * | 0 | 1 | 60 | 60 | 1800000 | F4 | A | D | 2025-01-01 09:00:00 | 2025-01-01 09:30:00 | 60 |
3272
+ * | 0 | 2 | 80 | 140 | 7200000 | F5 | D | C | 2025-01-01 10:30:00 | 2025-01-01 11:00:00 | 80 |
3273
+ *
3274
+ * Use `minimize: "weight"` to find the cheapest journey instead.
3275
+ * All ties on the chosen metric are returned.
3276
+ *
3164
3277
  * @param sourceColumn - The name of the column containing each connection's source node ID.
3165
3278
  * @param targetColumn - The name of the column containing each connection's target node ID.
3166
3279
  * @param edgeId - The name of the column uniquely identifying each connection (edge).
@@ -3173,6 +3286,8 @@ class SimpleTable extends Simple_js_1.default {
3173
3286
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
3174
3287
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
3175
3288
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3289
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3290
+ * @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.
3176
3291
  * @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`.
3177
3292
  * @returns The result table, so methods can be chained.
3178
3293
  * @category Graph Operations
@@ -3386,6 +3501,59 @@ class SimpleTable extends Simple_js_1.default {
3386
3501
  * | 0 | 1 | 3 | 3 | F3 | B | D | 2025-01-01 11:00:00 | 2025-01-01 12:00:00 | 3 |
3387
3502
  * | 0 | 2 | 2 | 5 | F1 | A | B | 2025-01-01 08:00:00 | 2025-01-01 10:00:00 | 2 |
3388
3503
  *
3504
+ * For the next two examples, `flights` contains these rows, with departure
3505
+ * and arrival stored as timestamps on the same day:
3506
+ *
3507
+ * | flightId | origin | destination | departure | arrival | price |
3508
+ * | --- | --- | --- | --- | --- | ---: |
3509
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
3510
+ * | F2 | B | C | 2025-01-01 12:00 | 2025-01-01 13:00 | 40 |
3511
+ * | F3 | A | C | 2025-01-01 09:00 | 2025-01-01 12:00 | 120 |
3512
+ *
3513
+ * Report elapsed time for every path, including layovers:
3514
+ *
3515
+ * @example
3516
+ * ```ts
3517
+ * await flights
3518
+ * .paths("origin", "destination", "flightId", "A", "C", {
3519
+ * startTimeColumn: "departure",
3520
+ * endTimeColumn: "arrival",
3521
+ * minGapMs: 60 * 60 * 1000,
3522
+ * elapsedTime: true,
3523
+ * })
3524
+ * .log();
3525
+ * ```
3526
+ *
3527
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3528
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3529
+ * | 0 | 1 | 1 | 1 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3530
+ * | 0 | 2 | 1 | 2 | 14400000 | F2 | B | C | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 40 |
3531
+ * | 1 | 1 | 1 | 1 | 10800000 | F3 | A | C | 2025-01-01 09:00:00 | 2025-01-01 12:00:00 | 120 |
3532
+ *
3533
+ * The route through B takes four hours (14,400,000 milliseconds),
3534
+ * including its two-hour layover. The direct flight takes three hours.
3535
+ *
3536
+ * Add up prices while continuing to report elapsed time for every path:
3537
+ *
3538
+ * @example
3539
+ * ```ts
3540
+ * await flights
3541
+ * .paths("origin", "destination", "flightId", "A", "C", {
3542
+ * startTimeColumn: "departure",
3543
+ * endTimeColumn: "arrival",
3544
+ * minGapMs: 60 * 60 * 1000,
3545
+ * elapsedTime: true,
3546
+ * weight: "price",
3547
+ * })
3548
+ * .log();
3549
+ * ```
3550
+ *
3551
+ * | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3552
+ * | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3553
+ * | 0 | 1 | 40 | 40 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3554
+ * | 0 | 2 | 40 | 80 | 14400000 | F2 | B | C | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 40 |
3555
+ * | 1 | 1 | 120 | 120 | 10800000 | F3 | A | C | 2025-01-01 09:00:00 | 2025-01-01 12:00:00 | 120 |
3556
+ *
3389
3557
  * @param sourceColumn - The name of the column containing each connection's source node ID.
3390
3558
  * @param targetColumn - The name of the column containing each connection's target node ID.
3391
3559
  * @param edgeId - The name of the column uniquely identifying each connection (edge).
@@ -3398,6 +3566,7 @@ class SimpleTable extends Simple_js_1.default {
3398
3566
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
3399
3567
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
3400
3568
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3569
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3401
3570
  * @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`.
3402
3571
  * @returns The result table, so methods can be chained.
3403
3572
  * @category Graph Operations
@@ -3653,6 +3822,56 @@ class SimpleTable extends Simple_js_1.default {
3653
3822
  * | B | 0 | 2 | 1 | 2 | F2 | C | A | 2025-01-01 10:00:00 |
3654
3823
  * | B | 0 | 3 | 1 | 3 | F1 | B | C | 2025-01-01 09:00:00 |
3655
3824
  *
3825
+ * For the next two examples, `flights` contains these rows, with departure
3826
+ * and arrival stored as timestamps on the same day:
3827
+ *
3828
+ * | flightId | origin | destination | departure | arrival | price |
3829
+ * | --- | --- | --- | --- | --- | ---: |
3830
+ * | F1 | A | B | 2025-01-01 09:00 | 2025-01-01 10:00 | 40 |
3831
+ * | F2 | B | A | 2025-01-01 12:00 | 2025-01-01 13:00 | 60 |
3832
+ *
3833
+ * Report elapsed time for every cycle, including layovers:
3834
+ *
3835
+ * @example
3836
+ * ```ts
3837
+ * await flights
3838
+ * .findCycles("origin", "destination", "flightId", "A", {
3839
+ * startTimeColumn: "departure",
3840
+ * endTimeColumn: "arrival",
3841
+ * minGapMs: 60 * 60 * 1000,
3842
+ * elapsedTime: true,
3843
+ * })
3844
+ * .log();
3845
+ * ```
3846
+ *
3847
+ * | start | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3848
+ * | --- | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3849
+ * | A | 0 | 1 | 1 | 1 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3850
+ * | A | 0 | 2 | 1 | 2 | 14400000 | F2 | B | A | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 60 |
3851
+ *
3852
+ * The return journey takes four hours (14,400,000 milliseconds),
3853
+ * including the two-hour layover at B.
3854
+ *
3855
+ * Add up prices while continuing to report elapsed time for every cycle:
3856
+ *
3857
+ * @example
3858
+ * ```ts
3859
+ * await flights
3860
+ * .findCycles("origin", "destination", "flightId", "A", {
3861
+ * startTimeColumn: "departure",
3862
+ * endTimeColumn: "arrival",
3863
+ * minGapMs: 60 * 60 * 1000,
3864
+ * elapsedTime: true,
3865
+ * weight: "price",
3866
+ * })
3867
+ * .log();
3868
+ * ```
3869
+ *
3870
+ * | start | pathId | step | weight | total | elapsedTimeMs | flightId | origin | destination | departure | arrival | price |
3871
+ * | --- | ---: | ---: | ---: | ---: | ---: | --- | --- | --- | --- | --- | ---: |
3872
+ * | A | 0 | 1 | 40 | 40 | 3600000 | F1 | A | B | 2025-01-01 09:00:00 | 2025-01-01 10:00:00 | 40 |
3873
+ * | A | 0 | 2 | 60 | 100 | 14400000 | F2 | B | A | 2025-01-01 12:00:00 | 2025-01-01 13:00:00 | 60 |
3874
+ *
3656
3875
  * @param sourceColumn - The name of the column containing each connection's source node ID.
3657
3876
  * @param targetColumn - The name of the column containing each connection's target node ID.
3658
3877
  * @param edgeId - The name of the column uniquely identifying each connection (edge).
@@ -3664,6 +3883,7 @@ class SimpleTable extends Simple_js_1.default {
3664
3883
  * @param options.minGapMs - The minimum gap between consecutive connections, in milliseconds. Must be a non-negative integer. Defaults to `0`. Requires a time column.
3665
3884
  * @param options.strictOrdering - Whether to reject zero-duration gaps between consecutive connections (equal timestamps). Defaults to `true`. Requires a time column.
3666
3885
  * @param options.weight - The name of the numeric column used as the cost of each connection. If omitted, each connection costs one.
3886
+ * @param options.elapsedTime - Whether to add cumulative `elapsedTimeMs` in milliseconds, including connection gaps. Defaults to `false`. Requires both time columns.
3667
3887
  * @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`.
3668
3888
  * @returns The result table, so methods can be chained.
3669
3889
  * @category Graph Operations
@@ -7101,23 +7321,24 @@ class SimpleTable extends Simple_js_1.default {
7101
7321
  * @example
7102
7322
  * ```ts
7103
7323
  * // Get GeoJSON data from a specific geometry column named 'myGeometries'
7104
- * const myGeomJson = await table.getGeoData("myGeometries");
7324
+ * const myGeomJson = await table.getGeoData({ column: "myGeometries" });
7105
7325
  * console.log(myGeomJson);
7106
7326
  * ```
7107
7327
  *
7108
7328
  * @example
7109
7329
  * ```ts
7110
7330
  * // Get GeoJSON data and rewind polygon coordinates for D3.js compatibility
7111
- * const rewoundGeojson = await table.getGeoData(undefined, { rewind: true });
7331
+ * const rewoundGeojson = await table.getGeoData({ rewind: true });
7112
7332
  * console.log(rewoundGeojson);
7113
7333
  * ```
7114
- * @param column - The name of the column storing the geometries. If omitted, the method will automatically attempt to find a geometry column.
7115
7334
  * @param options - An optional object with configuration options:
7335
+ * @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.
7116
7336
  * @param options.rewind - If `true`, rewinds the coordinates of polygons to follow the spherical winding order (important for D3.js). Defaults to `false`.
7117
7337
  * @returns A promise that resolves to a GeoJSON object representing the table's geospatial data.
7118
7338
  * @category Getting Data
7119
7339
  */
7120
- async getGeoData(column, options = {}) {
7340
+ async getGeoData(options = {}) {
7341
+ let column = options.column;
7121
7342
  if (column === undefined) {
7122
7343
  column = await (0, findGeoColumn_js_1.default)(this, "getGeoData()");
7123
7344
  }
@@ -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"}
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = graphRouteResultSchema;
7
7
  const validateGraphRouteResultSchema_js_1 = __importDefault(require("./validateGraphRouteResultSchema.js"));
8
8
  /** Derives the route result schema while preserving input columns and types. */
9
- function graphRouteResultSchema(schema, distanceType, method) {
10
- (0, validateGraphRouteResultSchema_js_1.default)(schema, method);
9
+ function graphRouteResultSchema(schema, distanceType, method, elapsedTime = false) {
10
+ (0, validateGraphRouteResultSchema_js_1.default)(schema, method, elapsedTime ? ["elapsedTimeMs"] : []);
11
11
  return {
12
12
  pathId: "BIGINT",
13
13
  step: "BIGINT",
14
14
  weight: distanceType,
15
15
  total: distanceType,
16
+ ...(elapsedTime ? { elapsedTimeMs: "DOUBLE" } : {}),
16
17
  ...schema,
17
18
  };
18
19
  }
@@ -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"}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = graphRouteResultSelect;
7
7
  const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
8
8
  /** Joins ranked route steps to their original input rows for final output. */
9
- function graphRouteResultSelect(rankedRelation, input, edgeIdColumn, includeStart = false) {
9
+ function graphRouteResultSelect(rankedRelation, input, edgeIdColumn, includeStart = false, elapsedTime = false) {
10
10
  const q = quoteIdentifier_js_1.default;
11
11
  const routeStep = `${q("unnested")}.${q("route_step")}`;
12
12
  const originalEdgeId = `${q("original")}.${q(edgeIdColumn.column)}`;
@@ -19,6 +19,9 @@ function graphRouteResultSelect(rankedRelation, input, edgeIdColumn, includeStar
19
19
  CAST(${q("unnested")}.${q("step")} AS BIGINT) AS ${q("step")},
20
20
  ${routeStep}.${q("weight")} AS ${q("weight")},
21
21
  ${routeStep}.${q("distance")} AS ${q("total")},
22
+ ${elapsedTime
23
+ ? `${routeStep}.${q("elapsedTimeMs")} AS ${q("elapsedTimeMs")},`
24
+ : ""}
22
25
  ${q("original")}.*
23
26
  FROM ${rankedRelation} AS ${q("ranked")},
24
27
  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,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = prepareGraphMetricOptions;
4
+ /** Resolves graph cost selection separately from optional elapsed-time reporting. */
5
+ function prepareGraphMetricOptions(options, method, optimize) {
6
+ if (options.elapsedTime !== undefined &&
7
+ typeof options.elapsedTime !== "boolean") {
8
+ throw new TypeError(`${method} options.elapsedTime must be a boolean.`);
9
+ }
10
+ const elapsedTime = options.elapsedTime === true;
11
+ if (elapsedTime &&
12
+ (options.startTimeColumn === undefined ||
13
+ options.endTimeColumn === undefined)) {
14
+ throw new TypeError(`${method} options.elapsedTime requires both options.startTimeColumn and options.endTimeColumn.`);
15
+ }
16
+ if (options.minimize !== undefined) {
17
+ if (!optimize) {
18
+ throw new TypeError(`${method} options.minimize is not supported because this method returns all routes.`);
19
+ }
20
+ if (options.minimize !== "weight" && options.minimize !== "elapsedTime") {
21
+ throw new TypeError(`${method} options.minimize must be "weight" or "elapsedTime".`);
22
+ }
23
+ if (options.minimize === "weight" && options.weight === undefined) {
24
+ throw new TypeError(`${method} options.minimize: "weight" requires options.weight.`);
25
+ }
26
+ if (options.minimize === "elapsedTime" && !elapsedTime) {
27
+ throw new TypeError(`${method} options.minimize: "elapsedTime" requires options.elapsedTime: true.`);
28
+ }
29
+ }
30
+ if (optimize && elapsedTime && options.weight !== undefined &&
31
+ options.minimize === undefined) {
32
+ throw new TypeError(`${method} when weight and elapsedTime are both enabled, specify options.minimize: "weight" or "elapsedTime".`);
33
+ }
34
+ return {
35
+ elapsedTime,
36
+ minimize: options.minimize ??
37
+ (options.weight !== undefined
38
+ ? "weight"
39
+ : elapsedTime
40
+ ? "elapsedTime"
41
+ : "connections"),
42
+ };
43
+ }
@@ -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,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E,WAAW,EACnB,OAAO,EAAE,4BAA4B,EACrC,MAAM,EAAE,MAAM,GACb,wBAAwB,CAgG1B"}
@@ -92,6 +92,13 @@ function prepareGraphTemporalSql(schema, options, method) {
92
92
  endTimeColumn: end?.column,
93
93
  gapParameter: gap.toString(),
94
94
  gapUnit,
95
+ journeyAnchor: (alias, direction) => direction === "outgoing"
96
+ ? temporalUnits(eventReference(alias, "__event_start"), startType, gapUnit)
97
+ : temporalUnits(eventReference(alias, "__event_end"), endType, gapUnit),
98
+ journeyElapsed: (alias, anchor, direction) => direction === "outgoing"
99
+ ? `(${temporalUnits(eventReference(alias, "__event_end"), endType, gapUnit)} - (${anchor}))`
100
+ : `((${anchor}) - ${temporalUnits(eventReference(alias, "__event_start"), startType, gapUnit)})`,
101
+ elapsedMilliseconds: (elapsed) => `(CAST(${elapsed} AS DOUBLE) / ${gapUnit === "nanosecond" ? 1000000 : 1000})`,
95
102
  eventSelections: (alias) => [
96
103
  `row_number() OVER () AS ${q("__event_id")}`,
97
104
  `${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,qCAA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