@orbat-mapper/control-measures 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -120,6 +120,9 @@ code.
120
120
  | <img src="media/direction-of-attack-aviation.svg" width="96" height="48" alt=""> | `direction-of-attack-aviation` | Direction of Attack — Airborne/Aviation | `140601` |
121
121
  | <img src="media/direction-of-main-attack.svg" width="96" height="48" alt=""> | `direction-of-main-attack` | Direction of Main Attack | `140602` |
122
122
  | <img src="media/direction-of-supporting-attack.svg" width="96" height="48" alt=""> | `direction-of-supporting-attack` | Direction of Supporting Attack | `140603` |
123
+ | <img src="media/bridgehead-line.svg" width="96" height="48" alt=""> | `bridgehead-line` | Bridgehead line | `141400` |
124
+ | <img src="media/holding-line.svg" width="96" height="48" alt=""> | `holding-line` | Holding line | `141500` |
125
+ | <img src="media/release-line.svg" width="96" height="48" alt=""> | `release-line` | Release line | `141600` |
123
126
  | <img src="media/ambush.svg" width="96" height="48" alt=""> | `ambush` | Ambush | `141700` |
124
127
  | <img src="media/handover-line.svg" width="96" height="48" alt=""> | `handover-line` | Handover line | `141800` |
125
128
  | <img src="media/battle-handover-line.svg" width="96" height="48" alt=""> | `battle-handover-line` | Battle handover line | `141900` |
@@ -195,11 +198,19 @@ code.
195
198
  | <img src="media/counterattack.svg" width="96" height="48" alt=""> | `counterattack` | Counterattack | `340600` |
196
199
  | <img src="media/counterattack-by-fire.svg" width="96" height="48" alt=""> | `counterattack-by-fire` | Counterattack by Fire | `340700` |
197
200
  | <img src="media/delay.svg" width="96" height="48" alt=""> | `delay` | Delay | `340800` |
201
+ | <img src="media/disrupt-mission-task.svg" width="96" height="48" alt=""> | `disrupt-mission-task` | Disrupt | `341000` |
198
202
  | <img src="media/fix-mission-task.svg" width="96" height="48" alt=""> | `fix-mission-task` | Fix | `341100` |
199
203
  | <img src="media/isolate.svg" width="96" height="48" alt=""> | `isolate` | Isolate | `341500` |
204
+ | <img src="media/penetrate.svg" width="96" height="48" alt=""> | `penetrate` | Penetrate | `341800` |
205
+ | <img src="media/retire.svg" width="96" height="48" alt=""> | `retire` | Retire/Retirement | `342000` |
200
206
  | <img src="media/cover.svg" width="96" height="48" alt=""> | `cover` | Cover | `342201` |
201
207
  | <img src="media/guard.svg" width="96" height="48" alt=""> | `guard` | Guard | `342202` |
202
208
  | <img src="media/screen.svg" width="96" height="48" alt=""> | `screen` | Screen | `342203` |
209
+ | <img src="media/seize.svg" width="96" height="48" alt=""> | `seize` | Seize | `342300` |
210
+ | <img src="media/withdraw.svg" width="96" height="48" alt=""> | `withdraw` | Withdraw | `342400` |
211
+ | <img src="media/withdraw-under-pressure.svg" width="96" height="48" alt=""> | `withdraw-under-pressure` | Withdraw Under Pressure | `342500` |
212
+ | <img src="media/rearward-passage-of-lines.svg" width="96" height="48" alt=""> | `rearward-passage-of-lines` | Rearward Passage of Lines | `344200` |
213
+ | <img src="media/disengage.svg" width="96" height="48" alt=""> | `disengage` | Disengage | `344400` |
203
214
 
204
215
  ### Generic Graphics
205
216
 
@@ -211,6 +222,7 @@ code.
211
222
  | <img src="media/polygon.svg" width="96" height="48" alt=""> | `polygon` | Polygon | `990102` |
212
223
  | <img src="media/rectangle.svg" width="96" height="48" alt=""> | `rectangle` | Rectangle | `990103` |
213
224
  | <img src="media/circle.svg" width="96" height="48" alt=""> | `circle` | Circle | `990104` |
225
+ | <img src="media/text.svg" width="96" height="48" alt=""> | `text` | Text | `990201` |
214
226
 
215
227
  <!-- /AUTO-GENERATED:measures-table -->
216
228
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as DEFAULT_COUNTERATTACK_BY_FIRE_OPTIONS, $t as createMidpointPerpendicularDrawRule, A as DEFAULT_PENETRATE_OPTIONS, At as TEXT_AMPLIFIER_FIELDS, B as DEFAULT_PHASE_LINE_OPTIONS, Bt as line26DrawRule, C as DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, Ct as DEFAULT_ANTITANK_DITCH_OPTIONS, D as DEFAULT_SCREEN_OPTIONS, Dt as DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, E as DEFAULT_SEIZE_OPTIONS, Et as DEFAULT_AREA_DEFENSE_OPTIONS, F as DEFAULT_HANDOVER_LINE_OPTIONS, Ft as DEFAULT_AIRBORNE_ATTACK_OPTIONS, G as DEFAULT_ENCIRCLEMENT_OPTIONS, Gt as ambushDrawRule, H as DEFAULT_FIX_MISSION_TASK_OPTIONS, Ht as line23DrawRule, I as DEFAULT_FORWARD_EDGE_OF_BATTLE_AREA_OPTIONS, It as rectangleDrawRule, J as DEFAULT_DISRUPT_MISSION_TASK_OPTIONS, Jt as penetrateDrawRule, K as DEFAULT_DISRUPT_OPTIONS, Kt as attackByFireDrawRule, L as DEFAULT_RELEASE_LINE_OPTIONS, Lt as axis1DrawRule, M as DEFAULT_FORTIFIED_AREA_OPTIONS, Mt as normalizeTextAmplifiers, N as DEFAULT_FORTIFIED_LINE_OPTIONS, Nt as resolveAmplifierPlacement, O as DEFAULT_RETIRE_OPTIONS, Ot as DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, P as DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, Pt as DEFAULT_AMBUSH_OPTIONS, Q as DEFAULT_TACTICAL_ARROW_OPTIONS, Qt as computeDefaultMidpointPerpendicularPoint, R as DEFAULT_HOLDING_LINE_OPTIONS, Rt as supportByFireDrawRule, S as DEFAULT_LANDING_ZONE_OPTIONS, St as DEFAULT_ANTITANK_WALL_OPTIONS, T as DEFAULT_WITHDRAW_OPTIONS, Tt as DEFAULT_AREA_OF_OPERATIONS_OPTIONS, U as DEFAULT_FIX_OPTIONS, Ut as turnDrawRule, V as DEFAULT_FLOT_OPTIONS, Vt as line24DrawRule, W as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, Wt as line1DrawRule, X as DEFAULT_DELAY_OPTIONS, Xt as disruptDrawRule, Y as DEFAULT_DISENGAGE_OPTIONS, Yt as centerRadiusDrawRule, Z as DEFAULT_COVER_OPTIONS, Zt as blockDrawRule, _ as DEFAULT_PICKUP_ZONE_OPTIONS, _t as DEFAULT_BLOCK_ARROW_OPTIONS, a as DEFINITIONS, an as computeInitialWidthPoint, at as DEFAULT_GENERIC_POLYGON_OPTIONS, b as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, bt as DEFAULT_ATTACK_HELICOPTER_OPTIONS, c as getDefaultOptions, cn as unproject, ct as DEFAULT_CLASSIC_ARROW_OPTIONS, d as DEFAULT_TURN_OPTIONS, dn as roundToFixed, dt as DEFAULT_BREACH_OPTIONS, en as getMidpointPerpendicularSignedDistance, et as DEFAULT_COUNTERATTACK_OPTIONS, f as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, ft as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, g as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, gt as DEFAULT_BOUNDARY_OPTIONS, h as SECONDARY_DIRECTION_OF_FIRE_DASH, ht as DEFAULT_LIGHT_LINE_OPTIONS, i as CONTROL_MEASURE_METADATA, in as calculateMetrics, it as DEFAULT_GENERIC_RECTANGLE_OPTIONS, j as DEFAULT_FRONTAL_ATTACK_OPTIONS, jt as canonicalTextAmplifierKey, k as DEFAULT_REARWARD_PASSAGE_OF_LINES_OPTIONS, kt as DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, l as listControlMeasureMetadata, ln as EPSILON, lt as DEFAULT_CANALIZE_OPTIONS, m as DEFAULT_SECONDARY_DIRECTION_OF_FIRE_OPTIONS, mt as DEFAULT_ENGINEER_WORK_LINE_OPTIONS, n as resolveStyleHints, nn as snapToMidpointPerpendicular, nt as DEFAULT_CLEAR_OPTIONS, o as getControlMeasureMetadata, on as haversineDistance, ot as DEFAULT_GENERIC_LINE_OPTIONS, p as DEFAULT_STRONG_POINT_OPTIONS, pt as DEFAULT_GENERIC_C2_LINE_OPTIONS, q as DEFAULT_GUARD_OPTIONS, qt as point12DrawRule, r as CONTROL_MEASURE_IDS, rn as createBaselineFrame, rt as DEFAULT_GENERIC_TEXT_OPTIONS, s as getControlMeasureMetadataByValue, sn as project, st as DEFAULT_GENERIC_CIRCLE_OPTIONS, t as renderControlMeasure, tn as pointOnMidpointPerpendicularAxis, tt as DEFAULT_SUPPORTING_ATTACK_OPTIONS, u as DEFAULT_TURNING_MOVEMENT_OPTIONS, un as getMetersPerPixel, ut as DEFAULT_BYPASS_OPTIONS, v as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, vt as DEFAULT_BLOCK_OPTIONS, w as DEFAULT_WITHDRAW_UNDER_PRESSURE_OPTIONS, wt as DEFAULT_ASSEMBLY_AREA_OPTIONS, x as DEFAULT_MAIN_ATTACK_OPTIONS, xt as DEFAULT_ATTACK_BY_FIRE_OPTIONS, y as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, yt as DEFAULT_BATTLE_POSITION_OPTIONS, z as DEFAULT_BRIDGEHEAD_LINE_OPTIONS, zt as line27DrawRule } from "./renderControlMeasure-CjSKeoV0.mjs";
1
+ import { $ as DEFAULT_COUNTERATTACK_BY_FIRE_OPTIONS, $t as createMidpointPerpendicularDrawRule, A as DEFAULT_PENETRATE_OPTIONS, At as TEXT_AMPLIFIER_FIELDS, B as DEFAULT_PHASE_LINE_OPTIONS, Bt as line26DrawRule, C as DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, Ct as DEFAULT_ANTITANK_DITCH_OPTIONS, D as DEFAULT_SCREEN_OPTIONS, Dt as DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, E as DEFAULT_SEIZE_OPTIONS, Et as DEFAULT_AREA_DEFENSE_OPTIONS, F as DEFAULT_HANDOVER_LINE_OPTIONS, Ft as DEFAULT_AIRBORNE_ATTACK_OPTIONS, G as DEFAULT_ENCIRCLEMENT_OPTIONS, Gt as ambushDrawRule, H as DEFAULT_FIX_MISSION_TASK_OPTIONS, Ht as line23DrawRule, I as DEFAULT_FORWARD_EDGE_OF_BATTLE_AREA_OPTIONS, It as rectangleDrawRule, J as DEFAULT_DISRUPT_MISSION_TASK_OPTIONS, Jt as penetrateDrawRule, K as DEFAULT_DISRUPT_OPTIONS, Kt as attackByFireDrawRule, L as DEFAULT_RELEASE_LINE_OPTIONS, Lt as axis1DrawRule, M as DEFAULT_FORTIFIED_AREA_OPTIONS, Mt as normalizeTextAmplifiers, N as DEFAULT_FORTIFIED_LINE_OPTIONS, Nt as resolveAmplifierPlacement, O as DEFAULT_RETIRE_OPTIONS, Ot as DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, P as DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, Pt as DEFAULT_AMBUSH_OPTIONS, Q as DEFAULT_TACTICAL_ARROW_OPTIONS, Qt as computeDefaultMidpointPerpendicularPoint, R as DEFAULT_HOLDING_LINE_OPTIONS, Rt as supportByFireDrawRule, S as DEFAULT_LANDING_ZONE_OPTIONS, St as DEFAULT_ANTITANK_WALL_OPTIONS, T as DEFAULT_WITHDRAW_OPTIONS, Tt as DEFAULT_AREA_OF_OPERATIONS_OPTIONS, U as DEFAULT_FIX_OPTIONS, Ut as turnDrawRule, V as DEFAULT_FLOT_OPTIONS, Vt as line24DrawRule, W as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, Wt as line1DrawRule, X as DEFAULT_DELAY_OPTIONS, Xt as disruptDrawRule, Y as DEFAULT_DISENGAGE_OPTIONS, Yt as centerRadiusDrawRule, Z as DEFAULT_COVER_OPTIONS, Zt as blockDrawRule, _ as DEFAULT_PICKUP_ZONE_OPTIONS, _t as DEFAULT_BLOCK_ARROW_OPTIONS, a as DEFINITIONS, an as computeInitialWidthPoint, at as DEFAULT_GENERIC_POLYGON_OPTIONS, b as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, bt as DEFAULT_ATTACK_HELICOPTER_OPTIONS, c as getDefaultOptions, cn as unproject, ct as DEFAULT_CLASSIC_ARROW_OPTIONS, d as DEFAULT_TURN_OPTIONS, dn as roundToFixed, dt as DEFAULT_BREACH_OPTIONS, en as getMidpointPerpendicularSignedDistance, et as DEFAULT_COUNTERATTACK_OPTIONS, f as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, ft as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, g as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, gt as DEFAULT_BOUNDARY_OPTIONS, h as SECONDARY_DIRECTION_OF_FIRE_DASH, ht as DEFAULT_LIGHT_LINE_OPTIONS, i as CONTROL_MEASURE_METADATA, in as calculateMetrics, it as DEFAULT_GENERIC_RECTANGLE_OPTIONS, j as DEFAULT_FRONTAL_ATTACK_OPTIONS, jt as canonicalTextAmplifierKey, k as DEFAULT_REARWARD_PASSAGE_OF_LINES_OPTIONS, kt as DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, l as listControlMeasureMetadata, ln as EPSILON, lt as DEFAULT_CANALIZE_OPTIONS, m as DEFAULT_SECONDARY_DIRECTION_OF_FIRE_OPTIONS, mt as DEFAULT_ENGINEER_WORK_LINE_OPTIONS, n as resolveStyleHints, nn as snapToMidpointPerpendicular, nt as DEFAULT_CLEAR_OPTIONS, o as getControlMeasureMetadata, on as haversineDistance, ot as DEFAULT_GENERIC_LINE_OPTIONS, p as DEFAULT_STRONG_POINT_OPTIONS, pt as DEFAULT_GENERIC_C2_LINE_OPTIONS, q as DEFAULT_GUARD_OPTIONS, qt as point12DrawRule, r as CONTROL_MEASURE_IDS, rn as createBaselineFrame, rt as DEFAULT_GENERIC_TEXT_OPTIONS, s as getControlMeasureMetadataByValue, sn as project, st as DEFAULT_GENERIC_CIRCLE_OPTIONS, t as renderControlMeasure, tn as pointOnMidpointPerpendicularAxis, tt as DEFAULT_SUPPORTING_ATTACK_OPTIONS, u as DEFAULT_TURNING_MOVEMENT_OPTIONS, un as getMetersPerPixel, ut as DEFAULT_BYPASS_OPTIONS, v as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, vt as DEFAULT_BLOCK_OPTIONS, w as DEFAULT_WITHDRAW_UNDER_PRESSURE_OPTIONS, wt as DEFAULT_ASSEMBLY_AREA_OPTIONS, x as DEFAULT_MAIN_ATTACK_OPTIONS, xt as DEFAULT_ATTACK_BY_FIRE_OPTIONS, y as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, yt as DEFAULT_BATTLE_POSITION_OPTIONS, z as DEFAULT_BRIDGEHEAD_LINE_OPTIONS, zt as line27DrawRule } from "./renderControlMeasure-awInmGJN.mjs";
2
2
  //#region src/freeze-orientation.ts
3
3
  /**
4
4
  * Dispatches to a measure kind's `freezeOrientation` hook (see
@@ -1,4 +1,4 @@
1
- import { a as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-CjSKeoV0.mjs";
1
+ import { a as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-awInmGJN.mjs";
2
2
  //#region src/preview/index.ts
3
3
  /** Side length (SVG units) of the repeating hatch tile in {@link PREVIEW_FILL_PATTERNS}. */
4
4
  const PREVIEW_PATTERN_TILE = 8;
@@ -4914,28 +4914,29 @@ function generateAntitankDitchTriangles(projectedPoints, toothHeight, toothWidth
4914
4914
  return triangles;
4915
4915
  }
4916
4916
  /**
4917
- * Projects `positions` and, when `options.smooth` is set, curves the result
4918
- * through the control points (centripetal Catmull-Rom) before the teeth are
4919
- * traced — matching Fortified Line's base-path smoothing. Returns the input
4920
- * unchanged (no project/unproject round trip) when smoothing is off.
4917
+ * When `options.smooth` is set, curves the projected control points
4918
+ * (centripetal Catmull-Rom) before the teeth are traced — matching Fortified
4919
+ * Line's base-path smoothing.
4921
4920
  */
4922
- function smoothedDitchBasePath(positions, options) {
4923
- const projectedPoints = positions.map((position) => project(position[0], position[1]));
4921
+ function ditchPaths(projectedPoints, options) {
4924
4922
  const smoothedPath = smoothLineVerts(projectedPoints, options, 16);
4925
4923
  const toothHeight = calculateAntitankDitchHeight(options);
4926
4924
  const toothWidthRatio = Math.max(EPSILON, options.toothWidthRatio ?? DEFAULT_TOOTH_WIDTH_RATIO$1);
4927
- return options.smooth && projectedPoints.length >= 3 ? evenlySpacePath(smoothedPath, toothWidthRatio * toothHeight) : smoothedPath;
4925
+ return {
4926
+ smoothedPath,
4927
+ basePath: options.smooth && projectedPoints.length >= 3 ? evenlySpacePath(smoothedPath, toothWidthRatio * toothHeight) : smoothedPath
4928
+ };
4928
4929
  }
4929
4930
  function buildAntitankDitchTriangles(basePath, options) {
4930
4931
  return generateAntitankDitchTriangles(basePath, calculateAntitankDitchHeight(options), options.toothWidthRatio ?? DEFAULT_TOOTH_WIDTH_RATIO$1);
4931
4932
  }
4932
4933
  function createAntitankDitchUnderConstruction(positions, options = {}, textAmplifiers = {}) {
4933
- const basePath = smoothedDitchBasePath(positions, options);
4934
+ const { smoothedPath, basePath } = ditchPaths(positions.map((position) => project(position[0], position[1])), options);
4934
4935
  const triangles = buildAntitankDitchTriangles(basePath, options);
4935
4936
  const baseLine = options.smooth ? basePath.map((point) => unproject(point[0], point[1])) : positions.map((position) => [position[0], position[1]]);
4936
4937
  const triangleLines = triangles.map((triangle) => triangle.map((point) => unproject(point[0], point[1])));
4937
4938
  const labels = [];
4938
- pushHostileEndLabels(labels, basePath, textAmplifiers.N, options);
4939
+ pushHostileEndLabels(labels, smoothedPath, textAmplifiers.N, options);
4939
4940
  return {
4940
4941
  type: "FeatureCollection",
4941
4942
  features: [{
@@ -4949,12 +4950,12 @@ function createAntitankDitchUnderConstruction(positions, options = {}, textAmpli
4949
4950
  };
4950
4951
  }
4951
4952
  function createAntitankDitchCompleted(positions, options = {}, textAmplifiers = {}) {
4952
- const basePath = smoothedDitchBasePath(positions, options);
4953
+ const { smoothedPath, basePath } = ditchPaths(positions.map((position) => project(position[0], position[1])), options);
4953
4954
  const polygons = buildAntitankDitchTriangles(basePath, options).map((triangle) => {
4954
4955
  return [[...triangle, triangle[0]].map((point) => unproject(point[0], point[1]))];
4955
4956
  });
4956
4957
  const labels = [];
4957
- pushHostileEndLabels(labels, basePath, textAmplifiers.N, options);
4958
+ pushHostileEndLabels(labels, smoothedPath, textAmplifiers.N, options);
4958
4959
  return {
4959
4960
  type: "FeatureCollection",
4960
4961
  features: [{
@@ -5050,10 +5051,9 @@ function createAntitankWall(positions, options = {}, textAmplifiers = {}) {
5050
5051
  const toothSpacingRatio = options.toothSpacingRatio ?? DEFAULT_TOOTH_SPACING_RATIO;
5051
5052
  const projectedPoints = positions.map((position) => project(position[0], position[1]));
5052
5053
  const smoothedPath = smoothLineVerts(projectedPoints, options, 16);
5053
- const basePath = options.smooth && projectedPoints.length >= 3 ? evenlySpacePath(smoothedPath, Math.max(EPSILON, toothWidthRatio) * toothHeight) : smoothedPath;
5054
- const wallLine = generateAntitankWallPoints(basePath, toothHeight, toothWidthRatio, toothSpacingRatio).map((point) => unproject(point[0], point[1]));
5054
+ const wallLine = generateAntitankWallPoints(options.smooth && projectedPoints.length >= 3 ? evenlySpacePath(smoothedPath, Math.max(EPSILON, toothWidthRatio) * toothHeight) : smoothedPath, toothHeight, toothWidthRatio, toothSpacingRatio).map((point) => unproject(point[0], point[1]));
5055
5055
  const labels = [];
5056
- pushHostileEndLabels(labels, basePath, textAmplifiers.N, options);
5056
+ pushHostileEndLabels(labels, smoothedPath, textAmplifiers.N, options);
5057
5057
  return {
5058
5058
  type: "FeatureCollection",
5059
5059
  features: [{
@@ -10349,7 +10349,7 @@ function createFLOT(positions, options = {}, textAmplifiers = {}) {
10349
10349
  }
10350
10350
  };
10351
10351
  const labels = [];
10352
- pushHostileEndLabels(labels, allPoints, textAmplifiers.N, options);
10352
+ pushHostileEndLabels(labels, smoothedPath, textAmplifiers.N, options);
10353
10353
  return {
10354
10354
  type: "FeatureCollection",
10355
10355
  features: [feature, ...labels]
@@ -11028,17 +11028,17 @@ function createFortifiedLine(positions, options = {}, textAmplifiers = {}) {
11028
11028
  const { smooth = DEFAULT_FORTIFIED_LINE_OPTIONS.smooth, smoothResolution = DEFAULT_FORTIFIED_LINE_OPTIONS.smoothResolution } = options;
11029
11029
  const safeSize = calculateEffectiveSize(options);
11030
11030
  const projectedPoints = positions.map((p) => project(p[0], p[1]));
11031
- const allPoints = generateFortifiedPoints(smooth ? evenlySpacePath(catmullRom(projectedPoints, normalizeSmoothResolution$2(smoothResolution, DEFAULT_SMOOTH_RESOLUTION$1)), 2 * safeSize) : projectedPoints, safeSize);
11031
+ const smoothedPath = smooth ? catmullRom(projectedPoints, normalizeSmoothResolution$2(smoothResolution, DEFAULT_SMOOTH_RESOLUTION$1)) : projectedPoints;
11032
11032
  const feature = {
11033
11033
  type: "Feature",
11034
11034
  properties: {},
11035
11035
  geometry: {
11036
11036
  type: "LineString",
11037
- coordinates: allPoints.map((p) => unproject(p[0], p[1]))
11037
+ coordinates: generateFortifiedPoints(smooth ? evenlySpacePath(smoothedPath, 2 * safeSize) : smoothedPath, safeSize).map((p) => unproject(p[0], p[1]))
11038
11038
  }
11039
11039
  };
11040
11040
  const labels = [];
11041
- pushHostileEndLabels(labels, allPoints, textAmplifiers.N, options);
11041
+ pushHostileEndLabels(labels, smoothedPath, textAmplifiers.N, options);
11042
11042
  return {
11043
11043
  type: "FeatureCollection",
11044
11044
  features: [feature, ...labels]
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Bridgehead line"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.00 26.22 L91.00 26.22" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 7.227 21.777)"><text x="7.227399999999998" y="21.7769" fill="#1e293b" font-family="sans-serif" font-size="7.416457060725835" font-weight="600" text-anchor="start" dominant-baseline="central">BL</text></g><g transform="rotate(0.000 88.773 21.777)"><text x="88.7726" y="21.7769" fill="#1e293b" font-family="sans-serif" font-size="7.416457060725835" font-weight="600" text-anchor="end" dominant-baseline="central">BL</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Disengage"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.59 38.93 L27.30 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M51.73 38.93 L73.45 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M13.73 43.00 L5.59 38.93 L13.73 34.86" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M73.45 38.93 L75.11 38.85 L76.76 38.60 L78.37 38.20 L79.94 37.64 L81.44 36.93 L82.87 36.07 L84.21 35.08 L85.44 33.96 L86.56 32.73 L87.55 31.39 L88.41 29.96 L89.12 28.46 L89.68 26.89 L90.09 25.28 L90.33 23.63 L90.41 21.96 L90.33 20.30 L90.09 18.65 L89.68 17.04 L89.12 15.47 L88.41 13.97 L87.55 12.54 L86.56 11.20 L85.44 9.97 L84.21 8.85 L82.87 7.86 L81.44 7.00 L79.94 6.29 L78.37 5.73 L76.76 5.33 L75.11 5.08 L73.45 5.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 39.518 38.929)"><text x="39.51785714285714" y="38.92857142857143" fill="#1e293b" font-family="sans-serif" font-size="11" font-weight="600" text-anchor="middle" dominant-baseline="central">DIS</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Disrupt"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M30.19 8.17 L30.19 39.83" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M30.19 8.17 L77.69 8.17" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M72.94 5.00 L77.69 8.17 L72.94 11.33" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M18.31 24.00 L40.88 24.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M50.38 24.00 L61.06 24.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M56.31 20.83 L61.06 24.00 L56.31 27.17" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M30.19 39.83 L51.56 39.83" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M46.81 36.67 L51.56 39.83 L46.81 43.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 45.625 24.000)"><text x="45.625" y="24" fill="#1e293b" font-family="sans-serif" font-size="11" font-weight="600" text-anchor="middle" dominant-baseline="central">D</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Holding line"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.00 26.22 L91.00 26.22" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 7.227 21.777)"><text x="7.227399999999998" y="21.7769" fill="#1e293b" font-family="sans-serif" font-size="7.416457060725835" font-weight="600" text-anchor="start" dominant-baseline="central">HL</text></g><g transform="rotate(0.000 88.773 21.777)"><text x="88.7726" y="21.7769" fill="#1e293b" font-family="sans-serif" font-size="7.416457060725835" font-weight="600" text-anchor="end" dominant-baseline="central">HL</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Penetrate"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M76.50 5.00 L76.50 43.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M19.50 24.00 L42.30 24.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M53.70 24.00 L76.50 24.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M70.80 20.20 L76.50 24.00 L70.80 27.80" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 48.000 24.000)"><text x="48" y="24" fill="#1e293b" font-family="sans-serif" font-size="11" font-weight="600" text-anchor="middle" dominant-baseline="central">P</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Rearward Passage of Lines"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.59 38.93 L25.27 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M53.77 38.93 L73.45 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M13.73 43.00 L5.59 38.93 L13.73 34.86" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M73.45 38.93 L75.11 38.85 L76.76 38.60 L78.37 38.20 L79.94 37.64 L81.44 36.93 L82.87 36.07 L84.21 35.08 L85.44 33.96 L86.56 32.73 L87.55 31.39 L88.41 29.96 L89.12 28.46 L89.68 26.89 L90.09 25.28 L90.33 23.63 L90.41 21.96 L90.33 20.30 L90.09 18.65 L89.68 17.04 L89.12 15.47 L88.41 13.97 L87.55 12.54 L86.56 11.20 L85.44 9.97 L84.21 8.85 L82.87 7.86 L81.44 7.00 L79.94 6.29 L78.37 5.73 L76.76 5.33 L75.11 5.08 L73.45 5.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 39.518 38.929)"><text x="39.51785714285714" y="38.92857142857143" fill="#1e293b" font-family="sans-serif" font-size="11" font-weight="600" text-anchor="middle" dominant-baseline="central">P(R)</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Release line"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.00 26.22 L91.00 26.22" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 7.227 21.777)"><text x="7.227399999999998" y="21.7769" fill="#1e293b" font-family="sans-serif" font-size="7.416457060725835" font-weight="600" text-anchor="start" dominant-baseline="central">RL</text></g><g transform="rotate(0.000 88.773 21.777)"><text x="88.7726" y="21.7769" fill="#1e293b" font-family="sans-serif" font-size="7.416457060725835" font-weight="600" text-anchor="end" dominant-baseline="central">RL</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Retire/Retirement"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.59 38.93 L33.41 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M45.62 38.93 L73.45 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M13.73 43.00 L5.59 38.93 L13.73 34.86" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M73.45 38.93 L75.11 38.85 L76.76 38.60 L78.37 38.20 L79.94 37.64 L81.44 36.93 L82.87 36.07 L84.21 35.08 L85.44 33.96 L86.56 32.73 L87.55 31.39 L88.41 29.96 L89.12 28.46 L89.68 26.89 L90.09 25.28 L90.33 23.63 L90.41 21.96 L90.33 20.30 L90.09 18.65 L89.68 17.04 L89.12 15.47 L88.41 13.97 L87.55 12.54 L86.56 11.20 L85.44 9.97 L84.21 8.85 L82.87 7.86 L81.44 7.00 L79.94 6.29 L78.37 5.73 L76.76 5.33 L75.11 5.08 L73.45 5.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 39.518 38.929)"><text x="39.51785714285714" y="38.92857142857143" fill="#1e293b" font-family="sans-serif" font-size="11" font-weight="600" text-anchor="middle" dominant-baseline="central">R</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Seize"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M38.15 15.64 L38.10 14.59 L37.95 13.57 L37.70 12.55 L37.34 11.57 L36.89 10.62 L36.36 9.73 L35.74 8.89 L35.03 8.12 L34.26 7.41 L33.42 6.79 L32.53 6.26 L31.59 5.81 L30.60 5.46 L29.59 5.21 L28.56 5.05 L27.51 5.00 L26.47 5.05 L25.44 5.21 L24.42 5.46 L23.44 5.81 L22.50 6.26 L21.60 6.79 L20.76 7.41 L19.99 8.12 L19.29 8.89 L18.67 9.73 L18.13 10.62 L17.68 11.57 L17.33 12.55 L17.08 13.57 L16.92 14.59 L16.87 15.64 L16.92 16.69 L17.08 17.71 L17.33 18.73 L17.68 19.71 L18.13 20.66 L18.67 21.55 L19.29 22.39 L19.99 23.16 L20.76 23.87 L21.60 24.49 L22.50 25.02 L23.44 25.47 L24.42 25.82 L25.44 26.07 L26.47 26.23 L27.51 26.28 L28.56 26.23 L29.59 26.07 L30.60 25.82 L31.59 25.47 L32.53 25.02 L33.42 24.49 L34.26 23.87 L35.03 23.16 L35.74 22.39 L36.36 21.55 L36.89 20.66 L37.34 19.71 L37.70 18.73 L37.95 17.71 L38.10 16.69 L38.15 15.64" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M38.15 15.64 L39.23 15.57 L40.31 15.52 L41.39 15.51 L42.46 15.54 L43.54 15.59 L44.62 15.66 L45.69 15.78 L46.76 15.92 L47.82 16.09 L48.88 16.30 L49.94 16.53 L50.98 16.79 L52.02 17.08 L53.05 17.40 L54.07 17.76 L55.08 18.13 L56.08 18.54 L57.06 18.98 L58.04 19.45 L59.00 19.94 L59.94 20.46" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M65.50 24.30 L66.32 25.00 L67.11 25.73 L67.89 26.47 L68.64 27.25 L69.38 28.04 L70.09 28.85 L70.78 29.68 L71.44 30.53 L72.08 31.40 L72.69 32.29 L73.28 33.19 L73.85 34.11 L74.38 35.05 L74.89 36.00 L75.38 36.96 L75.83 37.94 L76.26 38.93 L76.65 39.93 L77.02 40.94 L77.36 41.97 L77.67 43.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M79.13 37.59 L77.67 43.00 L73.58 39.17" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(34.695 62.808 22.255)"><text x="62.807840000000006" y="22.25504" fill="#1e293b" font-family="sans-serif" font-size="5.461731943945383" font-weight="600" text-anchor="middle" dominant-baseline="central">S</text></g></svg>
package/media/text.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Text"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><g transform="rotate(0.000 29.000 5.000)"><text x="29" y="5" fill="#1e293b" font-family="sans-serif" font-size="7.68" font-weight="600" text-anchor="middle" dominant-baseline="central">Text</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Withdraw Under Pressure"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.59 38.93 L29.34 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M49.70 38.93 L73.45 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M13.73 43.00 L5.59 38.93 L13.73 34.86" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M73.45 38.93 L75.11 38.85 L76.76 38.60 L78.37 38.20 L79.94 37.64 L81.44 36.93 L82.87 36.07 L84.21 35.08 L85.44 33.96 L86.56 32.73 L87.55 31.39 L88.41 29.96 L89.12 28.46 L89.68 26.89 L90.09 25.28 L90.33 23.63 L90.41 21.96 L90.33 20.30 L90.09 18.65 L89.68 17.04 L89.12 15.47 L88.41 13.97 L87.55 12.54 L86.56 11.20 L85.44 9.97 L84.21 8.85 L82.87 7.86 L81.44 7.00 L79.94 6.29 L78.37 5.73 L76.76 5.33 L75.11 5.08 L73.45 5.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 39.518 38.929)"><text x="39.51785714285714" y="38.92857142857143" fill="#1e293b" font-family="sans-serif" font-size="11" font-weight="600" text-anchor="middle" dominant-baseline="central">WP</text></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 48" width="96" height="48" role="img" aria-label="Withdraw"><rect x="0" y="0" width="96" height="48" rx="6" fill="#f8fafc" stroke="#e2e8f0"/><path d="M5.59 38.93 L33.41 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M45.62 38.93 L73.45 38.93" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M13.73 43.00 L5.59 38.93 L13.73 34.86" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><path d="M73.45 38.93 L75.11 38.85 L76.76 38.60 L78.37 38.20 L79.94 37.64 L81.44 36.93 L82.87 36.07 L84.21 35.08 L85.44 33.96 L86.56 32.73 L87.55 31.39 L88.41 29.96 L89.12 28.46 L89.68 26.89 L90.09 25.28 L90.33 23.63 L90.41 21.96 L90.33 20.30 L90.09 18.65 L89.68 17.04 L89.12 15.47 L88.41 13.97 L87.55 12.54 L86.56 11.20 L85.44 9.97 L84.21 8.85 L82.87 7.86 L81.44 7.00 L79.94 6.29 L78.37 5.73 L76.76 5.33 L75.11 5.08 L73.45 5.00" fill="none" stroke="#1e293b" stroke-width="1.25" stroke-linejoin="round" stroke-linecap="round"/><g transform="rotate(0.000 39.518 38.929)"><text x="39.51785714285714" y="38.92857142857143" fill="#1e293b" font-family="sans-serif" font-size="11" font-weight="600" text-anchor="middle" dominant-baseline="central">W</text></g></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbat-mapper/control-measures",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Library for drawing tactical graphics and control measures according to MIL-STD-2525 and APP-6 standards.",
5
5
  "license": "MIT",
6
6
  "author": "Orbat Mapper",