@diagrammo/dgmo 0.25.5 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/auto.mjs CHANGED
@@ -6058,7 +6058,7 @@ function extractSymbols(docText) {
6058
6058
  const m = NODE_ID_RE.exec(line12);
6059
6059
  if (m && !entities.includes(m[1])) entities.push(m[1]);
6060
6060
  }
6061
- return { kind: "flowchart", entities, keywords: [] };
6061
+ return { kind: "flowchart", entities };
6062
6062
  }
6063
6063
  var NODE_ID_RE;
6064
6064
  var init_flowchart_parser = __esm({
@@ -6815,8 +6815,7 @@ function extractSymbols2(docText) {
6815
6815
  }
6816
6816
  return {
6817
6817
  kind: "class",
6818
- entities,
6819
- keywords: ["extends", "implements", "abstract", "interface", "enum"]
6818
+ entities
6820
6819
  };
6821
6820
  }
6822
6821
  var CLASS_DECL_RE, INDENT_REL_ARROW_RE, REL_ARROW_RE, VISIBILITY_RE, STATIC_SUFFIX_RE, METHOD_RE, FIELD_RE, ARROW_TO_TYPE;
@@ -7285,8 +7284,7 @@ function extractSymbols3(docText) {
7285
7284
  }
7286
7285
  return {
7287
7286
  kind: "er",
7288
- entities,
7289
- keywords: ["pk", "fk", "unique", "nullable", "1", "*", "?"]
7287
+ entities
7290
7288
  };
7291
7289
  }
7292
7290
  var TABLE_DECL_RE, INDENT_REL_RE, CONSTRAINT_MAP, KNOWN_OPTIONS, REL_SYMBOLIC_RE, REL_KEYWORD_RE, KEYWORD_TO_SYMBOL, CONSTRAINT_KEYWORD_RE;
@@ -13208,7 +13206,7 @@ function extractSymbols4(docText) {
13208
13206
  }
13209
13207
  }
13210
13208
  }
13211
- return { kind: "infra", entities, keywords: [] };
13209
+ return { kind: "infra", entities };
13212
13210
  }
13213
13211
  var CONNECTION_RE, SIMPLE_CONNECTION_RE, ASYNC_CONNECTION_RE, ASYNC_SIMPLE_CONNECTION_RE, DEPRECATED_FANOUT_RE, GROUP_RE, TAG_VALUE_RE, COMPONENT_RE, PIPE_META_RE, SAMELINE_META_RE, PROPERTY_RE, LEGACY_SPACE_PROPERTY_RE, PERCENT_RE, RANGE_RE, EDGE_NODE_NAMES, TOP_LEVEL_OPTIONS, UNPARSED_SPLIT_RE;
13214
13212
  var init_parser9 = __esm({
@@ -16017,21 +16015,7 @@ function extractPertSymbols(docText) {
16017
16015
  }
16018
16016
  return {
16019
16017
  kind: "pert",
16020
- entities,
16021
- keywords: [
16022
- "time-unit",
16023
- "default-confidence",
16024
- "direction",
16025
- "node-detail",
16026
- "trials",
16027
- "seed",
16028
- "scrubber-trials",
16029
- "start-date",
16030
- "end-date",
16031
- "active-tag",
16032
- "tag",
16033
- "as"
16034
- ]
16018
+ entities
16035
16019
  };
16036
16020
  }
16037
16021
  function looksLikePert(content) {
@@ -32513,14 +32497,22 @@ function renderFlowchart(container, graph, layout, palette, isDark, onClickItem,
32513
32497
  const titleHeight = showTitle ? 40 : 0;
32514
32498
  const diagramW = layout.width;
32515
32499
  const diagramH = layout.height;
32516
- const availH = height - titleHeight;
32517
32500
  const scaleX = (width - sDiagramPadding * 2) / diagramW;
32518
- const scaleY = (availH - sDiagramPadding * 2) / diagramH;
32519
- const scale = Math.min(MAX_SCALE6, scaleX, scaleY);
32501
+ let scale;
32502
+ let canvasHeight;
32503
+ if (exportDims) {
32504
+ scale = Math.min(MAX_SCALE6, scaleX);
32505
+ canvasHeight = titleHeight + diagramH * scale + sDiagramPadding * 2;
32506
+ } else {
32507
+ const availH = height - titleHeight;
32508
+ const scaleY = (availH - sDiagramPadding * 2) / diagramH;
32509
+ scale = Math.min(MAX_SCALE6, scaleX, scaleY);
32510
+ canvasHeight = height;
32511
+ }
32520
32512
  const scaledW = diagramW * scale;
32521
32513
  const offsetX = (width - scaledW) / 2;
32522
32514
  const offsetY = titleHeight + sDiagramPadding;
32523
- const svg = d3Selection10.select(container).append("svg").attr("width", width).attr("height", height).attr("viewBox", `0 0 ${width} ${height}`).attr("preserveAspectRatio", "xMidYMin meet").style("font-family", FONT_FAMILY);
32515
+ const svg = d3Selection10.select(container).append("svg").attr("width", width).attr("height", canvasHeight).attr("viewBox", `0 0 ${width} ${canvasHeight}`).attr("preserveAspectRatio", "xMidYMin meet").style("font-family", FONT_FAMILY);
32524
32516
  if (ctx.isBelowFloor) {
32525
32517
  svg.attr("width", "100%");
32526
32518
  }
@@ -42087,14 +42079,22 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
42087
42079
  const titleHeight = showTitle ? 40 : 0;
42088
42080
  const diagramW = layout.width;
42089
42081
  const diagramH = layout.height;
42090
- const availH = height - titleHeight;
42091
42082
  const scaleX = (width - sDiagramPadding * 2) / diagramW;
42092
- const scaleY = (availH - sDiagramPadding * 2) / diagramH;
42093
- const scale = Math.min(MAX_SCALE7, scaleX, scaleY);
42083
+ let scale;
42084
+ let canvasHeight;
42085
+ if (exportDims) {
42086
+ scale = Math.min(MAX_SCALE7, scaleX);
42087
+ canvasHeight = titleHeight + diagramH * scale + sDiagramPadding * 2;
42088
+ } else {
42089
+ const availH = height - titleHeight;
42090
+ const scaleY = (availH - sDiagramPadding * 2) / diagramH;
42091
+ scale = Math.min(MAX_SCALE7, scaleX, scaleY);
42092
+ canvasHeight = height;
42093
+ }
42094
42094
  const scaledW = diagramW * scale;
42095
42095
  const offsetX = (width - scaledW) / 2;
42096
42096
  const offsetY = titleHeight + sDiagramPadding;
42097
- const svg = d3Selection14.select(container).append("svg").attr("width", width).attr("height", height).attr("viewBox", `0 0 ${width} ${height}`).attr("preserveAspectRatio", "xMidYMin meet").style("font-family", FONT_FAMILY);
42097
+ const svg = d3Selection14.select(container).append("svg").attr("width", width).attr("height", canvasHeight).attr("viewBox", `0 0 ${width} ${canvasHeight}`).attr("preserveAspectRatio", "xMidYMin meet").style("font-family", FONT_FAMILY);
42098
42098
  if (ctx.isBelowFloor) {
42099
42099
  svg.attr("width", "100%");
42100
42100
  }
@@ -50139,7 +50139,8 @@ function renderRaci(container, parsed, palette, isDark, handlers, exportDims) {
50139
50139
  }
50140
50140
  const colBottomY = cursorY + sColumnBottomPad;
50141
50141
  const totalHeight = colBottomY + sVMargin;
50142
- const svg = d3Selection21.select(container).append("svg").attr("xmlns", "http://www.w3.org/2000/svg").attr("width", width).attr("height", Math.max(height, totalHeight)).attr("viewBox", `0 0 ${width} ${Math.max(height, totalHeight)}`).attr("preserveAspectRatio", "xMidYMin meet").attr("font-family", FONT_FAMILY).style("background", "transparent");
50142
+ const svgHeight = exportDims ? totalHeight : Math.max(height, totalHeight);
50143
+ const svg = d3Selection21.select(container).append("svg").attr("xmlns", "http://www.w3.org/2000/svg").attr("width", width).attr("height", svgHeight).attr("viewBox", `0 0 ${width} ${svgHeight}`).attr("preserveAspectRatio", "xMidYMin meet").attr("font-family", FONT_FAMILY).style("background", "transparent");
50143
50144
  if (ctx.isBelowFloor) {
50144
50145
  svg.attr("width", "100%");
50145
50146
  }
@@ -59254,7 +59255,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
59254
59255
 
59255
59256
  // src/auto/index.ts
59256
59257
  init_safe_href();
59257
- var VERSION = "0.25.5";
59258
+ var VERSION = "0.26.0";
59258
59259
  var DEFAULTS = {
59259
59260
  theme: "auto",
59260
59261
  palette: "nord",