datastake-daf 0.6.372 → 0.6.374

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.
@@ -12668,7 +12668,7 @@ const {
12668
12668
  Paragraph: Paragraph$1
12669
12669
  } = antd.Typography;
12670
12670
  const checkHasActiveFilterValues = filtersConfig => {
12671
- if (!filtersConfig?.filtersConfig || !filtersConfig?.selectedFilters) return false;
12671
+ if (!(filtersConfig !== null && filtersConfig !== void 0 && filtersConfig.filtersConfig) || !(filtersConfig !== null && filtersConfig !== void 0 && filtersConfig.selectedFilters)) return false;
12672
12672
  const filterConfigKeys = Object.keys(filtersConfig.filtersConfig);
12673
12673
  const selectedFilters = filtersConfig.selectedFilters;
12674
12674
  return filterConfigKeys.some(key => {
@@ -12676,27 +12676,28 @@ const checkHasActiveFilterValues = filtersConfig => {
12676
12676
  return value !== undefined && value !== null && value !== "";
12677
12677
  });
12678
12678
  };
12679
- const useHeader = ({
12680
- title = "",
12681
- tooltip = "",
12682
- supportText = "",
12683
- tags = [],
12684
- actionButtons: _actionButtons = [],
12685
- titleTooltip,
12686
- className,
12687
- addedHeader = null,
12688
- addedHeaderFirst,
12689
- extraButtons: _extraButtons = [],
12690
- onDownload,
12691
- downloadDisabled,
12692
- goBackTo,
12693
- loading,
12694
- renderExtraComponents,
12695
- app = "",
12696
- isViewMode = false,
12697
- filtersConfig = {}
12698
- }) => {
12699
- const hasActiveFilterValues = React.useMemo(() => checkHasActiveFilterValues(filtersConfig), [filtersConfig?.filtersConfig, filtersConfig?.selectedFilters]);
12679
+ const useHeader = _ref => {
12680
+ let {
12681
+ title = "",
12682
+ tooltip = "",
12683
+ supportText = "",
12684
+ tags = [],
12685
+ actionButtons: _actionButtons = [],
12686
+ titleTooltip,
12687
+ className,
12688
+ addedHeader = null,
12689
+ addedHeaderFirst,
12690
+ extraButtons: _extraButtons = [],
12691
+ onDownload,
12692
+ downloadDisabled,
12693
+ goBackTo,
12694
+ loading,
12695
+ renderExtraComponents,
12696
+ app = "",
12697
+ isViewMode = false,
12698
+ filtersConfig = {}
12699
+ } = _ref;
12700
+ const hasActiveFilterValues = React.useMemo(() => checkHasActiveFilterValues(filtersConfig), [filtersConfig === null || filtersConfig === void 0 ? void 0 : filtersConfig.filtersConfig, filtersConfig === null || filtersConfig === void 0 ? void 0 : filtersConfig.selectedFilters]);
12700
12701
  const [showFilters, setShowFilters] = React.useState(() => checkHasActiveFilterValues(filtersConfig));
12701
12702
  const hasFilters = filtersConfig && Object.keys(filtersConfig).length > 0;
12702
12703
  React.useEffect(() => {
@@ -12738,9 +12739,9 @@ const useHeader = ({
12738
12739
  const buttonCont = React.useRef();
12739
12740
  const [mainContWidth, setMainContWidth] = React.useState(600);
12740
12741
  const [buttonContWidth, setButtonContWidth] = React.useState(0);
12741
- const hasSupportText = !!supportText?.length;
12742
- const hasTags = !!tags?.length;
12743
- const hasButtons = React.useMemo(() => !!(actionButtons?.length || extraButtons?.length), [actionButtons, extraButtons]);
12742
+ const hasSupportText = !!(supportText !== null && supportText !== void 0 && supportText.length);
12743
+ const hasTags = !!(tags !== null && tags !== void 0 && tags.length);
12744
+ const hasButtons = React.useMemo(() => !!(actionButtons !== null && actionButtons !== void 0 && actionButtons.length || extraButtons !== null && extraButtons !== void 0 && extraButtons.length), [actionButtons, extraButtons]);
12744
12745
  React.useEffect(() => {
12745
12746
  const mainContObserver = new ResizeObserver(entries => {
12746
12747
  const _mainEntry = entries[0];
@@ -51012,12 +51013,14 @@ function DualAxesChart(_ref) {
51012
51013
  });
51013
51014
  }
51014
51015
 
51016
+ // components/Nodes/PrimaryNode.jsx
51015
51017
  const MAIN_NODE_WIDTH = 300;
51016
51018
  const MAIN_NODE_HEIGHT = 150;
51017
51019
  function PrimaryNode({
51018
51020
  id,
51019
51021
  data
51020
51022
  }) {
51023
+ const isPdf = data?.isPdf; // Get isPdf from data prop
51021
51024
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
51022
51025
  children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
51023
51026
  type: "source",
@@ -51036,8 +51039,9 @@ function PrimaryNode({
51036
51039
  opacity: 0
51037
51040
  }
51038
51041
  }), /*#__PURE__*/jsxRuntime.jsxs(Style$f, {
51042
+ $isPdf: isPdf,
51039
51043
  className: "flex",
51040
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
51044
+ children: [" ", /*#__PURE__*/jsxRuntime.jsx("div", {
51041
51045
  className: "left flex flex-column justify-center",
51042
51046
  style: {
51043
51047
  background: data.backgroundColor || "#ade9e1",
@@ -51072,7 +51076,7 @@ function PrimaryNode({
51072
51076
  },
51073
51077
  children: data?.name || ""
51074
51078
  })
51075
- }), data.onClick && /*#__PURE__*/jsxRuntime.jsx("div", {
51079
+ }), !data.isPdf && /*#__PURE__*/jsxRuntime.jsx("div", {
51076
51080
  className: "go-to",
51077
51081
  onClick: () => {
51078
51082
  if (typeof data.onClick === "function") {
@@ -51147,13 +51151,14 @@ function PrimaryNode({
51147
51151
  }
51148
51152
  const Style$f = dt.div`
51149
51153
  width: ${MAIN_NODE_WIDTH}px;
51154
+ height: ${MAIN_NODE_HEIGHT}px; /* Explicitly set height */
51150
51155
  display: flex;
51151
51156
  background: white;
51152
51157
  border-radius: 8px;
51153
- box-shadow: 0px 3.76px 10.03px 0px #00000014;
51154
- box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
51155
51158
  overflow: hidden;
51156
- box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
51159
+ box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
51160
+ -webkit-print-color-adjust: exact;
51161
+ print-color-adjust: exact;
51157
51162
 
51158
51163
  .left {
51159
51164
  width: 32px;
@@ -51245,7 +51250,8 @@ PrimaryNode.propTypes = {
51245
51250
  icon: PropTypes__default["default"].string,
51246
51251
  backgroundColor: PropTypes__default["default"].string,
51247
51252
  totalSources: PropTypes__default["default"].number,
51248
- onClick: PropTypes__default["default"].func
51253
+ onClick: PropTypes__default["default"].func,
51254
+ isPdf: PropTypes__default["default"].bool
51249
51255
  })
51250
51256
  };
51251
51257
 
@@ -51366,6 +51372,7 @@ const Style$e = dt.div`
51366
51372
  }
51367
51373
  `;
51368
51374
 
51375
+ // components/Nodes/NameNode.jsx
51369
51376
  const NAME_CARD_WIDTH = 315;
51370
51377
  const {
51371
51378
  useToken: useToken$7
@@ -51377,6 +51384,7 @@ function NameNode({
51377
51384
  token
51378
51385
  } = useToken$7();
51379
51386
  const translateFN = typeof data?.t === "function" ? data.t : key => key;
51387
+ const isPdf = data?.isPdf;
51380
51388
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
51381
51389
  children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
51382
51390
  type: "source",
@@ -51395,6 +51403,7 @@ function NameNode({
51395
51403
  opacity: 0
51396
51404
  }
51397
51405
  }), /*#__PURE__*/jsxRuntime.jsxs(Style$d, {
51406
+ $isPdf: isPdf,
51398
51407
  style: {
51399
51408
  opacity: data.isEmpty ? 0.5 : 1
51400
51409
  },
@@ -51445,7 +51454,7 @@ function NameNode({
51445
51454
  }
51446
51455
  })
51447
51456
  }) : null]
51448
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
51457
+ }), !isPdf && /*#__PURE__*/jsxRuntime.jsx("div", {
51449
51458
  style: {
51450
51459
  marginLeft: "auto"
51451
51460
  },
@@ -51482,27 +51491,30 @@ function NameNode({
51482
51491
  });
51483
51492
  }
51484
51493
  const Style$d = dt.div`
51485
- width: ${NAME_CARD_WIDTH}px;
51486
- display: flex;
51487
- background: white;
51488
- border-radius: 8px;
51489
- box-shadow: 0px 3.76px 10.03px 0px #00000014;
51490
- box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
51491
- overflow: hidden;
51492
- box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
51494
+ width: ${NAME_CARD_WIDTH}px;
51495
+ height: 55px;
51496
+ display: flex;
51497
+ background: white;
51498
+ border-radius: 8px;
51499
+ overflow: hidden;
51500
+ box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
51501
+ -webkit-print-color-adjust: exact;
51502
+ print-color-adjust: exact;
51493
51503
 
51494
- .left {
51495
- width: 32px;
51496
- background: red;
51497
- border-top-left-radius: 12px;
51498
- border-bottom-left-radius: 12px;
51499
- }
51504
+ .left {
51505
+ width: 32px;
51506
+ background: red;
51507
+ border-top-left-radius: 12px;
51508
+ border-bottom-left-radius: 12px;
51509
+ }
51500
51510
 
51501
- .right {
51502
- padding: 16px 12px;
51503
- width: 100%
51504
- border-bottom: 1px solid var(--base-gray-30);
51505
- }
51511
+ .right {
51512
+ padding: 0px 12px;
51513
+ width: 100%;
51514
+ display: flex;
51515
+ align-items: center;
51516
+ border-bottom: none;
51517
+ }
51506
51518
  `;
51507
51519
 
51508
51520
  const Style$c = dt.div`
@@ -51728,6 +51740,7 @@ function ExpandedNode({
51728
51740
  });
51729
51741
  }
51730
51742
 
51743
+ // components/Edges/TooltipEdge.jsx
51731
51744
  function ToolTipEdge({
51732
51745
  sourceX,
51733
51746
  sourceY,
@@ -51737,7 +51750,20 @@ function ToolTipEdge({
51737
51750
  data,
51738
51751
  targetPosition
51739
51752
  }) {
51740
- const [smoothPath] = react.getSmoothStepPath({
51753
+ const {
51754
+ isOnlyOne,
51755
+ isPdf
51756
+ } = data; // Destructure isPdf from data
51757
+
51758
+ const [edgePath] = isPdf && isOnlyOne // Condition for straight path in PDF for single nodes
51759
+ ? react.getStraightPath({
51760
+ sourceX,
51761
+ sourceY,
51762
+ sourcePosition,
51763
+ targetX,
51764
+ targetY,
51765
+ targetPosition
51766
+ }) : react.getSmoothStepPath({
51741
51767
  sourceX,
51742
51768
  sourceY,
51743
51769
  sourcePosition,
@@ -51754,8 +51780,8 @@ function ToolTipEdge({
51754
51780
  });
51755
51781
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
51756
51782
  children: [/*#__PURE__*/jsxRuntime.jsx(react.BaseEdge, {
51757
- path: smoothPath
51758
- }), /*#__PURE__*/jsxRuntime.jsx(react.EdgeLabelRenderer, {
51783
+ path: edgePath
51784
+ }), " ", /*#__PURE__*/jsxRuntime.jsx(react.EdgeLabelRenderer, {
51759
51785
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
51760
51786
  className: "button-edge__label nodrag nopan",
51761
51787
  style: {
@@ -51953,6 +51979,7 @@ function VerticalPathEdge({
51953
51979
  });
51954
51980
  }
51955
51981
 
51982
+ // components/Edges/DefaultEdge.jsx
51956
51983
  const ACTIVE_OPACITY = 1;
51957
51984
  const DISABLED_OPACITY = 0.5;
51958
51985
  const EDGE_STROKE = "#9DA4AE";
@@ -51972,12 +51999,22 @@ function DefaultEdge({
51972
51999
  associatedNodes = [],
51973
52000
  renderTooltipItems = () => [],
51974
52001
  getTotal = () => 0,
51975
- tooltipTitle
52002
+ tooltipTitle,
52003
+ isPdf // Destructure isPdf from data
51976
52004
  } = data;
51977
52005
  const isSelected = associatedNodes?.includes(source) && associatedNodes?.includes(target) && activeNode;
51978
52006
  const opacity = activeNode ? isSelected ? ACTIVE_OPACITY : DISABLED_OPACITY : ACTIVE_OPACITY;
51979
52007
  const arrowHeadId = `arrow-head-${id}`;
51980
- const [edgePath] = react.getSmoothStepPath({
52008
+ const [edgePath] = isPdf // Use straight path for PDF
52009
+ ? react.getStraightPath({
52010
+ sourceX,
52011
+ sourceY,
52012
+ sourcePosition: data.type === "left" ? react.Position.Left : react.Position.Right,
52013
+ targetX,
52014
+ targetY,
52015
+ targetPosition: data.type === "left" ? react.Position.Right : react.Position.Left
52016
+ }) : react.getSmoothStepPath({
52017
+ // Use smooth path for normal rendering
51981
52018
  sourceX,
51982
52019
  sourceY,
51983
52020
  targetX,
@@ -52077,6 +52114,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
52077
52114
  t,
52078
52115
  withDuration = true,
52079
52116
  onFilterChange,
52117
+ isPdf,
52080
52118
  ...props
52081
52119
  }, ref) {
52082
52120
  const {
@@ -52133,7 +52171,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
52133
52171
  duration: withDuration ? 300 : undefined
52134
52172
  },
52135
52173
  ...props,
52136
- children: /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
52174
+ children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
52137
52175
  position: "bottom-right",
52138
52176
  showFitView: false,
52139
52177
  showInteractive: false,
@@ -52650,37 +52688,67 @@ function positionDataNodes(_ref2) {
52650
52688
  total,
52651
52689
  mainNode,
52652
52690
  type,
52653
- hasContent
52691
+ hasContent,
52692
+ isPdf
52654
52693
  } = _ref2;
52655
52694
  const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
52656
52695
  const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
52657
- const siblingSpace = () => {
52658
- var _iconNode$data;
52659
- if (type === "primaryNode") {
52660
- var _iconNode$data$childr;
52661
- if ((iconNode === null || iconNode === void 0 || (_iconNode$data$childr = iconNode.data.children) === null || _iconNode$data$childr === void 0 ? void 0 : _iconNode$data$childr.length) === 1 && hasContent) {
52662
- return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
52696
+
52697
+ // const siblingSpace = () => {
52698
+ // if (type === "primaryNode") {
52699
+ // if (iconNode?.data.children?.length === 1 && hasContent) {
52700
+ // return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
52701
+ // }
52702
+ // return DEFAULT_PRIMARY_NODE_SPACE;
52703
+ // }
52704
+ // if (iconNode?.data?.children?.length === 0) {
52705
+ // return NO_CHILDREN_SIBLING_SPACE;
52706
+ // }
52707
+ // return DEFAULT_SIBLING_SPACE;
52708
+ // };
52709
+
52710
+ // const Y_SPACE_FROM_SIBLINGS = siblingSpace();
52711
+ const X_SPACE_FROM_ICON_NODE = 130;
52712
+ // const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
52713
+
52714
+ // const totalHeight = total * MIN_SPACE_REQUIRED;
52715
+
52716
+ iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
52717
+ // const startY = iconNodeCenterY - totalHeight / 2;
52718
+ // const END_Y = startY + totalHeight;
52719
+
52720
+ // const yOffset = index * MIN_SPACE_REQUIRED;
52721
+ let yPosition;
52722
+ const iconNodeHandleCenterY = iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 10 : 0);
52723
+ if (type === "nameNode" && total === 1 || isPdf) {
52724
+ yPosition = iconNodeHandleCenterY - DATA_NODE_HEIGHT / 2 - 7;
52725
+ } else {
52726
+ const siblingSpace = () => {
52727
+ var _iconNode$data;
52728
+ if (type === "primaryNode") {
52729
+ var _iconNode$data$childr;
52730
+ if ((iconNode === null || iconNode === void 0 || (_iconNode$data$childr = iconNode.data.children) === null || _iconNode$data$childr === void 0 ? void 0 : _iconNode$data$childr.length) === 1 && hasContent) {
52731
+ return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
52732
+ }
52733
+ return DEFAULT_PRIMARY_NODE_SPACE;
52663
52734
  }
52664
- return DEFAULT_PRIMARY_NODE_SPACE;
52665
- }
52666
- if ((iconNode === null || iconNode === void 0 || (_iconNode$data = iconNode.data) === null || _iconNode$data === void 0 || (_iconNode$data = _iconNode$data.children) === null || _iconNode$data === void 0 ? void 0 : _iconNode$data.length) === 0) {
52667
- return NO_CHILDREN_SIBLING_SPACE;
52735
+ if ((iconNode === null || iconNode === void 0 || (_iconNode$data = iconNode.data) === null || _iconNode$data === void 0 || (_iconNode$data = _iconNode$data.children) === null || _iconNode$data === void 0 ? void 0 : _iconNode$data.length) === 0) {
52736
+ return NO_CHILDREN_SIBLING_SPACE;
52737
+ }
52738
+ return DEFAULT_SIBLING_SPACE;
52739
+ };
52740
+ const Y_SPACE_FROM_SIBLINGS = siblingSpace();
52741
+ const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
52742
+ const totalHeight = total * MIN_SPACE_REQUIRED;
52743
+ const startY = iconNodeHandleCenterY - totalHeight / 2;
52744
+ const END_Y = startY + totalHeight;
52745
+ const yOffset = index * MIN_SPACE_REQUIRED;
52746
+ yPosition = startY + yOffset;
52747
+ if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
52748
+ yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
52749
+ } else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
52750
+ yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
52668
52751
  }
52669
- return DEFAULT_SIBLING_SPACE;
52670
- };
52671
- const Y_SPACE_FROM_SIBLINGS = siblingSpace();
52672
- const X_SPACE_FROM_ICON_NODE = 130;
52673
- const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
52674
- const totalHeight = total * MIN_SPACE_REQUIRED;
52675
- const iconNodeCenterY = iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
52676
- const startY = iconNodeCenterY - totalHeight / 2;
52677
- const END_Y = startY + totalHeight;
52678
- const yOffset = index * MIN_SPACE_REQUIRED;
52679
- let yPosition = startY + yOffset;
52680
- if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
52681
- yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
52682
- } else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
52683
- yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
52684
52752
  }
52685
52753
  return {
52686
52754
  x: isLeftSide ? iconNode.position.x - (DATA_NODE_WIDTH + X_SPACE_FROM_ICON_NODE) : iconNode.position.x + (X_SPACE_FROM_ICON_NODE + ICON_NODE_WIDTH),
@@ -52726,7 +52794,8 @@ function StakeholderMappings(_ref3) {
52726
52794
  isEmpty: true,
52727
52795
  name: emptyString,
52728
52796
  icon: (data === null || data === void 0 ? void 0 : data.icon) || "DashboardStakeholder",
52729
- t: t
52797
+ t: t,
52798
+ isPdf: isPdf
52730
52799
  },
52731
52800
  position: {
52732
52801
  x: centerX - MAIN_NODE_WIDTH / 2,
@@ -52748,7 +52817,8 @@ function StakeholderMappings(_ref3) {
52748
52817
  onClick: (data === null || data === void 0 ? void 0 : data.onClick) || undefined,
52749
52818
  totalSources: data === null || data === void 0 ? void 0 : data.totalSources,
52750
52819
  backgroundColor: (data === null || data === void 0 ? void 0 : data.backgroundColor) || "#ade9e1",
52751
- iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a"
52820
+ iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a",
52821
+ isPdf: isPdf
52752
52822
  },
52753
52823
  position: {
52754
52824
  x: centerX - MAIN_NODE_WIDTH / 2,
@@ -52798,11 +52868,13 @@ function StakeholderMappings(_ref3) {
52798
52868
  setSelectedIconNodes(openIconNOdes.map(node => node.id));
52799
52869
  }
52800
52870
  const dataNodes = openIconNOdes.flatMap(node => {
52871
+ var _node$data, _node$data2;
52801
52872
  const children = node.data.children || [];
52802
52873
  const total = (children === null || children === void 0 ? void 0 : children.length) || 0;
52803
52874
  const iconNodeId = node.id;
52875
+ (node === null || node === void 0 || (_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data.content) !== undefined && (node === null || node === void 0 || (_node$data2 = node.data) === null || _node$data2 === void 0 ? void 0 : _node$data2.content) !== null;
52804
52876
  if (children.length === 0) {
52805
- var _node$data, _node$data2, _node$data3, _node$data4, _node$data5;
52877
+ var _node$data3, _node$data4, _node$data5, _node$data6, _node$data7;
52806
52878
  iconEdges.push({
52807
52879
  id: "".concat(node.id, "-empty"),
52808
52880
  source: node.id,
@@ -52810,7 +52882,8 @@ function StakeholderMappings(_ref3) {
52810
52882
  type: "tooltipEdge",
52811
52883
  data: {
52812
52884
  isEmpty: true,
52813
- isOnlyOne: true
52885
+ isOnlyOne: true,
52886
+ isPdf: isPdf
52814
52887
  },
52815
52888
  targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
52816
52889
  });
@@ -52820,9 +52893,10 @@ function StakeholderMappings(_ref3) {
52820
52893
  type: "nameNode",
52821
52894
  data: {
52822
52895
  isEmpty: true,
52823
- name: ((_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data.emptyName) || "No".concat((_node$data2 = node.data) === null || _node$data2 === void 0 ? void 0 : _node$data2.name, " identified"),
52824
- icon: (_node$data3 = node.data) === null || _node$data3 === void 0 ? void 0 : _node$data3.type,
52825
- t: t
52896
+ name: ((_node$data3 = node.data) === null || _node$data3 === void 0 ? void 0 : _node$data3.emptyName) || "No".concat((_node$data4 = node.data) === null || _node$data4 === void 0 ? void 0 : _node$data4.name, " identified"),
52897
+ icon: (_node$data5 = node.data) === null || _node$data5 === void 0 ? void 0 : _node$data5.type,
52898
+ t: t,
52899
+ isPdf: isPdf
52826
52900
  },
52827
52901
  position: positionDataNodes({
52828
52902
  isLeftSide: node.data.order % 2 !== 0,
@@ -52832,21 +52906,22 @@ function StakeholderMappings(_ref3) {
52832
52906
  total: 1,
52833
52907
  mainNode,
52834
52908
  type: "nameNode",
52835
- hasContent: (node === null || node === void 0 || (_node$data4 = node.data) === null || _node$data4 === void 0 ? void 0 : _node$data4.content) !== undefined && (node === null || node === void 0 || (_node$data5 = node.data) === null || _node$data5 === void 0 ? void 0 : _node$data5.content) !== null ? true : false
52909
+ hasContent: (node === null || node === void 0 || (_node$data6 = node.data) === null || _node$data6 === void 0 ? void 0 : _node$data6.content) !== undefined && (node === null || node === void 0 || (_node$data7 = node.data) === null || _node$data7 === void 0 ? void 0 : _node$data7.content) !== null ? true : false
52836
52910
  })
52837
52911
  }];
52838
52912
  }
52839
52913
  if (isPdf) {
52840
- var _node$data6, _node$data7, _node$data8, _node$data9, _node$data10, _node$data11, _node$data12, _node$data13, _node$data14;
52914
+ var _node$data8, _node$data9, _node$data10, _node$data11, _node$data12, _node$data13, _node$data14, _node$data15, _node$data16;
52841
52915
  iconEdges.push({
52842
52916
  id: "".concat(node.id, "-empty"),
52843
52917
  source: node.id,
52844
52918
  target: node.data.name + "-name-node",
52845
52919
  type: "tooltipEdge",
52846
52920
  data: {
52847
- name: node === null || node === void 0 || (_node$data6 = node.data) === null || _node$data6 === void 0 ? void 0 : _node$data6.name,
52848
- content: node === null || node === void 0 || (_node$data7 = node.data) === null || _node$data7 === void 0 ? void 0 : _node$data7.content,
52849
- isOnlyOne: true
52921
+ name: node === null || node === void 0 || (_node$data8 = node.data) === null || _node$data8 === void 0 ? void 0 : _node$data8.name,
52922
+ content: node === null || node === void 0 || (_node$data9 = node.data) === null || _node$data9 === void 0 ? void 0 : _node$data9.content,
52923
+ isOnlyOne: true,
52924
+ isPdf: true
52850
52925
  },
52851
52926
  targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
52852
52927
  });
@@ -52855,11 +52930,11 @@ function StakeholderMappings(_ref3) {
52855
52930
  id: node.data.name + "-name-node",
52856
52931
  type: "nameNode",
52857
52932
  data: {
52858
- name: node === null || node === void 0 || (_node$data8 = node.data) === null || _node$data8 === void 0 ? void 0 : _node$data8.name,
52859
- content: node === null || node === void 0 || (_node$data9 = node.data) === null || _node$data9 === void 0 ? void 0 : _node$data9.content,
52860
- icon: (_node$data10 = node.data) === null || _node$data10 === void 0 ? void 0 : _node$data10.type,
52861
- backgroundColor: node === null || node === void 0 || (_node$data11 = node.data) === null || _node$data11 === void 0 ? void 0 : _node$data11.activeColour,
52862
- iconColor: node === null || node === void 0 || (_node$data12 = node.data) === null || _node$data12 === void 0 ? void 0 : _node$data12.hoverColor,
52933
+ name: node === null || node === void 0 || (_node$data10 = node.data) === null || _node$data10 === void 0 ? void 0 : _node$data10.name,
52934
+ content: node === null || node === void 0 || (_node$data11 = node.data) === null || _node$data11 === void 0 ? void 0 : _node$data11.content,
52935
+ icon: (_node$data12 = node.data) === null || _node$data12 === void 0 ? void 0 : _node$data12.type,
52936
+ backgroundColor: node === null || node === void 0 || (_node$data13 = node.data) === null || _node$data13 === void 0 ? void 0 : _node$data13.activeColour,
52937
+ iconColor: node === null || node === void 0 || (_node$data14 = node.data) === null || _node$data14 === void 0 ? void 0 : _node$data14.hoverColor,
52863
52938
  isPdf: true,
52864
52939
  t: t
52865
52940
  },
@@ -52867,16 +52942,17 @@ function StakeholderMappings(_ref3) {
52867
52942
  isLeftSide: node.data.order % 2 !== 0,
52868
52943
  isAboveMainNode: node.data.order <= 2,
52869
52944
  iconNode: node,
52945
+ isPdf: true,
52870
52946
  index: 0,
52871
52947
  total: 1,
52872
52948
  mainNode,
52873
52949
  type: "nameNode",
52874
- hasContent: (node === null || node === void 0 || (_node$data13 = node.data) === null || _node$data13 === void 0 ? void 0 : _node$data13.content) !== undefined && (node === null || node === void 0 || (_node$data14 = node.data) === null || _node$data14 === void 0 ? void 0 : _node$data14.content) !== null ? true : false
52950
+ hasContent: (node === null || node === void 0 || (_node$data15 = node.data) === null || _node$data15 === void 0 ? void 0 : _node$data15.content) !== undefined && (node === null || node === void 0 || (_node$data16 = node.data) === null || _node$data16 === void 0 ? void 0 : _node$data16.content) !== null ? true : false
52875
52951
  })
52876
52952
  }];
52877
52953
  }
52878
52954
  return children.map((child, index) => {
52879
- var _node$data15;
52955
+ var _node$data17;
52880
52956
  iconEdges.push({
52881
52957
  id: "".concat(node.id, "-").concat(child.id),
52882
52958
  source: node.id,
@@ -52888,7 +52964,8 @@ function StakeholderMappings(_ref3) {
52888
52964
  value: child.value,
52889
52965
  tooltipHeader: child.tooltipHeader,
52890
52966
  tooltipLabel: (child === null || child === void 0 ? void 0 : child.tooltipLabel) || "Holding",
52891
- totalSources: child.totalSources || 0
52967
+ totalSources: child.totalSources || 0,
52968
+ isPdf: isPdf
52892
52969
  },
52893
52970
  targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
52894
52971
  });
@@ -52915,7 +52992,8 @@ function StakeholderMappings(_ref3) {
52915
52992
  backgroundColor: child.backgroundColor || "#ade9e1",
52916
52993
  iconColor: child.iconColor || "#08949a",
52917
52994
  icon: child.icon || "UserCircle",
52918
- content: children.length
52995
+ content: children.length,
52996
+ isPdf: isPdf
52919
52997
  },
52920
52998
  position: positionDataNodes({
52921
52999
  isLeftSide,
@@ -52925,7 +53003,8 @@ function StakeholderMappings(_ref3) {
52925
53003
  total,
52926
53004
  mainNode,
52927
53005
  type: child.type || "primaryNode",
52928
- hasContent: node !== null && node !== void 0 && (_node$data15 = node.data) !== null && _node$data15 !== void 0 && _node$data15.content ? true : false
53006
+ hasContent: node !== null && node !== void 0 && (_node$data17 = node.data) !== null && _node$data17 !== void 0 && _node$data17.content ? true : false,
53007
+ isPdf: isPdf
52929
53008
  })
52930
53009
  };
52931
53010
  });
@@ -52939,7 +53018,8 @@ function StakeholderMappings(_ref3) {
52939
53018
  type: "default",
52940
53019
  data: {
52941
53020
  group: child.id,
52942
- type: "mainNode"
53021
+ type: "mainNode",
53022
+ isPdf: isPdf
52943
53023
  }
52944
53024
  };
52945
53025
  });
@@ -52965,7 +53045,8 @@ function StakeholderMappings(_ref3) {
52965
53045
  duration: 300
52966
53046
  });
52967
53047
  },
52968
- ref: reactFlowWrapper
53048
+ ref: reactFlowWrapper,
53049
+ isPdf: isPdf
52969
53050
  });
52970
53051
  }
52971
53052
  var index$1 = withProvider(StakeholderMappings);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.372",
3
+ "version": "0.6.374",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -457,6 +457,34 @@ export const Pdf = {
457
457
  showBackground: true,
458
458
  isPercentage: true,
459
459
  shouldSeperateLegendName: true,
460
+ formattedXAxis: (s) => {
461
+ if (!s) return "";
462
+
463
+ const limit = 20;
464
+ let result = "";
465
+ let line = "";
466
+
467
+ for (let word of s.split(" ")) {
468
+ if ((line + word).length <= limit) {
469
+ line += (line ? " " : "") + word;
470
+ } else if (word.length > limit) {
471
+ // break long word with hyphen
472
+ while (word.length > limit) {
473
+ result += word.slice(0, limit - 1) + "-\n";
474
+ word = word.slice(limit - 1);
475
+ }
476
+ line = word;
477
+ } else {
478
+ // move current line into result
479
+ if (line) result += line + "\n";
480
+ line = word;
481
+ }
482
+ }
483
+
484
+ if (line) result += line;
485
+
486
+ return result;
487
+ },
460
488
  },
461
489
  render: (args) => {
462
490
  return <Widget title="Pdf Column Chart" className={"with-border-header"}>
@@ -116,6 +116,24 @@ export const WithEmptyState = {
116
116
  },
117
117
  };
118
118
 
119
+ export const Pdf = {
120
+ args: {},
121
+ render: () => {
122
+ return (
123
+ <Widget title="Stakeholder Mappings" className="with-border-header no-px no-p-body">
124
+ <div
125
+ style={{
126
+ height: "70vh",
127
+ width: "100%",
128
+ }}
129
+ >
130
+ <StakeholderMappings data={storyConfig5} isPdf={false} />
131
+ </div>
132
+ </Widget>
133
+ );
134
+ },
135
+ };
136
+
119
137
  export const Test = {
120
138
  args: {},
121
139
  render: () => {
@@ -72,44 +72,77 @@ function positionDataNodes({
72
72
  mainNode,
73
73
  type,
74
74
  hasContent,
75
+ isPdf,
75
76
  }) {
76
77
  const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
77
78
  const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
78
79
 
79
- const siblingSpace = () => {
80
- if (type === "primaryNode") {
81
- if (iconNode?.data.children?.length === 1 && hasContent) {
82
- return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
83
- }
84
- return DEFAULT_PRIMARY_NODE_SPACE;
85
- }
86
- if (iconNode?.data?.children?.length === 0) {
87
- return NO_CHILDREN_SIBLING_SPACE;
88
- }
89
- return DEFAULT_SIBLING_SPACE;
90
- };
91
-
92
- const Y_SPACE_FROM_SIBLINGS = siblingSpace();
80
+ // const siblingSpace = () => {
81
+ // if (type === "primaryNode") {
82
+ // if (iconNode?.data.children?.length === 1 && hasContent) {
83
+ // return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
84
+ // }
85
+ // return DEFAULT_PRIMARY_NODE_SPACE;
86
+ // }
87
+ // if (iconNode?.data?.children?.length === 0) {
88
+ // return NO_CHILDREN_SIBLING_SPACE;
89
+ // }
90
+ // return DEFAULT_SIBLING_SPACE;
91
+ // };
92
+
93
+ // const Y_SPACE_FROM_SIBLINGS = siblingSpace();
93
94
  const X_SPACE_FROM_ICON_NODE = 130;
94
- const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
95
+ // const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
95
96
 
96
- const totalHeight = total * MIN_SPACE_REQUIRED;
97
+ // const totalHeight = total * MIN_SPACE_REQUIRED;
97
98
 
98
99
  const iconNodeCenterY =
99
100
  iconNode.position.y +
100
101
  ICON_NODE_HEIGHT / 2 +
101
102
  (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
102
- const startY = iconNodeCenterY - totalHeight / 2;
103
- const END_Y = startY + totalHeight;
103
+ // const startY = iconNodeCenterY - totalHeight / 2;
104
+ // const END_Y = startY + totalHeight;
104
105
 
105
- const yOffset = index * MIN_SPACE_REQUIRED;
106
+ // const yOffset = index * MIN_SPACE_REQUIRED;
107
+ let yPosition;
106
108
 
107
- let yPosition = startY + yOffset;
108
109
 
109
- if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
110
- yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
111
- } else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
112
- yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
110
+ const iconNodeHandleCenterY = iconNode.position.y + (ICON_NODE_HEIGHT / 2) + (hasContent ? 10 : 0);
111
+
112
+
113
+ if ((type === "nameNode" && total === 1) || isPdf) {
114
+ yPosition = iconNodeHandleCenterY - (DATA_NODE_HEIGHT / 2) - 7;
115
+ } else {
116
+ const siblingSpace = () => {
117
+ if (type === "primaryNode") {
118
+ if (iconNode?.data.children?.length === 1 && hasContent) {
119
+ return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
120
+ }
121
+ return DEFAULT_PRIMARY_NODE_SPACE;
122
+ }
123
+ if (iconNode?.data?.children?.length === 0) {
124
+ return NO_CHILDREN_SIBLING_SPACE;
125
+ }
126
+ return DEFAULT_SIBLING_SPACE;
127
+ };
128
+
129
+ const Y_SPACE_FROM_SIBLINGS = siblingSpace();
130
+ const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
131
+
132
+ const totalHeight = total * MIN_SPACE_REQUIRED;
133
+
134
+ const startY = iconNodeHandleCenterY - totalHeight / 2;
135
+ const END_Y = startY + totalHeight;
136
+
137
+ const yOffset = index * MIN_SPACE_REQUIRED;
138
+
139
+ yPosition = startY + yOffset;
140
+
141
+ if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
142
+ yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
143
+ } else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
144
+ yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
145
+ }
113
146
  }
114
147
 
115
148
  return {
@@ -160,6 +193,7 @@ function StakeholderMappings({
160
193
  name: emptyString,
161
194
  icon: data?.icon || "DashboardStakeholder",
162
195
  t: t,
196
+ isPdf: isPdf,
163
197
  },
164
198
  position: {
165
199
  x: centerX - MAIN_NODE_WIDTH / 2,
@@ -183,6 +217,7 @@ function StakeholderMappings({
183
217
  totalSources: data?.totalSources,
184
218
  backgroundColor: data?.backgroundColor || "#ade9e1",
185
219
  iconColor: data?.iconColor || "#08949a",
220
+ isPdf: isPdf,
186
221
  },
187
222
  position: {
188
223
  x: centerX - MAIN_NODE_WIDTH / 2,
@@ -247,6 +282,7 @@ function StakeholderMappings({
247
282
  const children = node.data.children || [];
248
283
  const total = children?.length || 0;
249
284
  const iconNodeId = node.id;
285
+ const iconNodeHasContent = node?.data?.content !== undefined && node?.data?.content !== null;
250
286
 
251
287
  if (children.length === 0) {
252
288
  iconEdges.push({
@@ -257,6 +293,7 @@ function StakeholderMappings({
257
293
  data: {
258
294
  isEmpty: true,
259
295
  isOnlyOne: true,
296
+ isPdf: isPdf,
260
297
  },
261
298
  targetHandle:
262
299
  node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target",
@@ -273,6 +310,7 @@ function StakeholderMappings({
273
310
  name: node.data?.emptyName || `No${node.data?.name} identified`,
274
311
  icon: node.data?.type,
275
312
  t: t,
313
+ isPdf: isPdf,
276
314
  },
277
315
  position: positionDataNodes({
278
316
  isLeftSide: node.data.order % 2 !== 0,
@@ -301,6 +339,7 @@ function StakeholderMappings({
301
339
  name: node?.data?.name,
302
340
  content: node?.data?.content,
303
341
  isOnlyOne: true,
342
+ isPdf: true,
304
343
  },
305
344
  targetHandle:
306
345
  node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target",
@@ -325,6 +364,7 @@ function StakeholderMappings({
325
364
  isLeftSide: node.data.order % 2 !== 0,
326
365
  isAboveMainNode: node.data.order <= 2,
327
366
  iconNode: node,
367
+ isPdf: true,
328
368
  index: 0,
329
369
  total: 1,
330
370
  mainNode,
@@ -351,6 +391,7 @@ function StakeholderMappings({
351
391
  tooltipHeader: child.tooltipHeader,
352
392
  tooltipLabel: child?.tooltipLabel || "Holding",
353
393
  totalSources: child.totalSources || 0,
394
+ isPdf: isPdf,
354
395
  },
355
396
  targetHandle:
356
397
  node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target",
@@ -382,6 +423,7 @@ function StakeholderMappings({
382
423
  iconColor: child.iconColor || "#08949a",
383
424
  icon: child.icon || "UserCircle",
384
425
  content: children.length,
426
+ isPdf: isPdf,
385
427
  },
386
428
  position: positionDataNodes({
387
429
  isLeftSide,
@@ -392,6 +434,7 @@ function StakeholderMappings({
392
434
  mainNode,
393
435
  type: child.type || "primaryNode",
394
436
  hasContent: node?.data?.content ? true : false,
437
+ isPdf: isPdf,
395
438
  }),
396
439
  };
397
440
  });
@@ -407,6 +450,7 @@ function StakeholderMappings({
407
450
  data: {
408
451
  group: child.id,
409
452
  type: "mainNode",
453
+ isPdf: isPdf,
410
454
  },
411
455
  };
412
456
  });
@@ -444,6 +488,7 @@ function StakeholderMappings({
444
488
  });
445
489
  }}
446
490
  ref={reactFlowWrapper}
491
+ isPdf={isPdf}
447
492
  />
448
493
  );
449
494
  }
@@ -32,6 +32,7 @@ const BaseGraph = forwardRef(function BaseGraph(
32
32
  t,
33
33
  withDuration = true,
34
34
  onFilterChange,
35
+ isPdf,
35
36
  ...props
36
37
  },
37
38
  ref,
@@ -87,43 +88,45 @@ const BaseGraph = forwardRef(function BaseGraph(
87
88
  }}
88
89
  {...props}
89
90
  >
90
- <Controls position="bottom-right" showFitView={false} showInteractive={false}>
91
- <ControlButton
92
- onClick={() => {
93
- fitView({
94
- padding: 0.1,
95
- nodes: [...nodesToFit],
96
- duration: withDuration ? 300 : undefined,
97
- });
98
- }}
99
- >
100
- <AimOutlined height={20} width={20} />
101
- </ControlButton>
102
- <ControlButton
103
- onClick={() => {
104
- const viewport = getViewport();
105
- setViewport({
106
- x: viewport.x,
107
- y: viewport.y + 20,
108
- zoom: viewport.zoom,
109
- });
110
- }}
111
- >
112
- <UpOutlined height={20} width={20}></UpOutlined>
113
- </ControlButton>
114
- <ControlButton
115
- onClick={() => {
116
- const viewport = getViewport();
117
- setViewport({
118
- x: viewport.x,
119
- y: viewport.y - 20,
120
- zoom: viewport.zoom,
121
- });
122
- }}
123
- >
124
- <DownOutlined height={20} width={20}></DownOutlined>
125
- </ControlButton>
126
- </Controls>
91
+ {!isPdf && (
92
+ <Controls position="bottom-right" showFitView={false} showInteractive={false}>
93
+ <ControlButton
94
+ onClick={() => {
95
+ fitView({
96
+ padding: 0.1,
97
+ nodes: [...nodesToFit],
98
+ duration: withDuration ? 300 : undefined,
99
+ });
100
+ }}
101
+ >
102
+ <AimOutlined height={20} width={20} />
103
+ </ControlButton>
104
+ <ControlButton
105
+ onClick={() => {
106
+ const viewport = getViewport();
107
+ setViewport({
108
+ x: viewport.x,
109
+ y: viewport.y + 20,
110
+ zoom: viewport.zoom,
111
+ });
112
+ }}
113
+ >
114
+ <UpOutlined height={20} width={20}></UpOutlined>
115
+ </ControlButton>
116
+ <ControlButton
117
+ onClick={() => {
118
+ const viewport = getViewport();
119
+ setViewport({
120
+ x: viewport.x,
121
+ y: viewport.y - 20,
122
+ zoom: viewport.zoom,
123
+ });
124
+ }}
125
+ >
126
+ <DownOutlined height={20} width={20}></DownOutlined>
127
+ </ControlButton>
128
+ </Controls>
129
+ )}
127
130
  </ReactFlow>
128
131
  </div>
129
132
  </ComponentWithFocus>
@@ -1,6 +1,7 @@
1
+ // components/Edges/DefaultEdge.jsx
1
2
  import React from "react";
2
3
  import { Popover } from "antd";
3
- import { BaseEdge, EdgeLabelRenderer, getSmoothStepPath, Position } from "@xyflow/react";
4
+ import { BaseEdge, EdgeLabelRenderer, getSmoothStepPath, Position, getStraightPath } from "@xyflow/react"; // Import getStraightPath
4
5
  import { renderTooltipJsx } from "../../../../../utils/tooltip.js";
5
6
  // import { activeOpacity, disabledOpacity, edgeStroke, edgeStrokeActive } from '../../config';
6
7
 
@@ -25,21 +26,31 @@ export default function DefaultEdge({
25
26
  renderTooltipItems = () => [],
26
27
  getTotal = () => 0,
27
28
  tooltipTitle,
29
+ isPdf, // Destructure isPdf from data
28
30
  } = data;
29
31
  const isSelected =
30
32
  associatedNodes?.includes(source) && associatedNodes?.includes(target) && activeNode;
31
33
  const opacity = activeNode ? (isSelected ? ACTIVE_OPACITY : DISABLED_OPACITY) : ACTIVE_OPACITY;
32
34
  const arrowHeadId = `arrow-head-${id}`;
33
35
 
34
- const [edgePath] = getSmoothStepPath({
35
- sourceX,
36
- sourceY,
37
- targetX,
38
- targetY,
39
- sourcePosition: data.type === "left" ? Position.Left : Position.Right,
40
- targetPosition: data.type === "left" ? Position.Right : Position.Left,
41
- borderRadius: 20,
42
- });
36
+ const [edgePath] = isPdf // Use straight path for PDF
37
+ ? getStraightPath({
38
+ sourceX,
39
+ sourceY,
40
+ sourcePosition: data.type === "left" ? Position.Left : Position.Right,
41
+ targetX,
42
+ targetY,
43
+ targetPosition: data.type === "left" ? Position.Right : Position.Left,
44
+ })
45
+ : getSmoothStepPath({ // Use smooth path for normal rendering
46
+ sourceX,
47
+ sourceY,
48
+ targetX,
49
+ targetY,
50
+ sourcePosition: data.type === "left" ? Position.Left : Position.Right,
51
+ targetPosition: data.type === "left" ? Position.Right : Position.Left,
52
+ borderRadius: 20,
53
+ });
43
54
 
44
55
  const centerY = data.moreLeft ? sourceY : targetY;
45
56
 
@@ -123,4 +134,4 @@ export default function DefaultEdge({
123
134
  />
124
135
  </g>
125
136
  );
126
- }
137
+ }
@@ -1,10 +1,11 @@
1
+ // components/Edges/TooltipEdge.jsx
1
2
  import { Popover, Tag } from "antd";
2
3
  import {
3
4
  BaseEdge,
4
5
  EdgeLabelRenderer,
5
6
  getEdgeCenter,
6
7
  getSmoothStepPath,
7
- // getStraightPath,
8
+ getStraightPath, // Import getStraightPath
8
9
  } from "@xyflow/react";
9
10
  import { renderTooltipJsx } from "../../../../../utils/tooltip.js";
10
11
  import CustomIcon from "../../../Icon/CustomIcon.jsx";
@@ -30,15 +31,26 @@ export default function ToolTipEdge({
30
31
  data,
31
32
  targetPosition,
32
33
  }) {
33
- const [smoothPath] = getSmoothStepPath({
34
- sourceX,
35
- sourceY,
36
- sourcePosition,
37
- targetX,
38
- targetY,
39
- targetPosition,
40
- borderRadius: 15,
41
- });
34
+ const { isOnlyOne, isPdf } = data; // Destructure isPdf from data
35
+
36
+ const [edgePath] = isPdf && isOnlyOne // Condition for straight path in PDF for single nodes
37
+ ? getStraightPath({
38
+ sourceX,
39
+ sourceY,
40
+ sourcePosition,
41
+ targetX,
42
+ targetY,
43
+ targetPosition,
44
+ })
45
+ : getSmoothStepPath({
46
+ sourceX,
47
+ sourceY,
48
+ sourcePosition,
49
+ targetX,
50
+ targetY,
51
+ targetPosition,
52
+ borderRadius: 15,
53
+ });
42
54
 
43
55
  const center = getEdgeCenter({
44
56
  sourceX,
@@ -49,7 +61,7 @@ export default function ToolTipEdge({
49
61
 
50
62
  return (
51
63
  <>
52
- <BaseEdge path={smoothPath} />
64
+ <BaseEdge path={edgePath} /> {/* Use edgePath here */}
53
65
  <EdgeLabelRenderer>
54
66
  <div
55
67
  className="button-edge__label nodrag nopan"
@@ -107,4 +119,4 @@ export default function ToolTipEdge({
107
119
  </EdgeLabelRenderer>
108
120
  </>
109
121
  );
110
- }
122
+ }
@@ -1,3 +1,4 @@
1
+ // components/Nodes/NameNode.jsx
1
2
  import React from "react";
2
3
  import styled from "styled-components";
3
4
  import { Handle, Position } from "@xyflow/react";
@@ -13,6 +14,8 @@ const { useToken } = theme;
13
14
  export default function NameNode({ data }) {
14
15
  const { token } = useToken();
15
16
  const translateFN = typeof data?.t === "function" ? data.t : (key) => key;
17
+ const isPdf = data?.isPdf;
18
+
16
19
  return (
17
20
  <>
18
21
  <Handle
@@ -34,6 +37,7 @@ export default function NameNode({ data }) {
34
37
  }}
35
38
  />
36
39
  <Style
40
+ $isPdf={isPdf}
37
41
  style={{
38
42
  opacity: data.isEmpty ? 0.5 : 1,
39
43
  }}
@@ -95,19 +99,21 @@ export default function NameNode({ data }) {
95
99
  ) : null}
96
100
  </div>
97
101
 
98
- <div
99
- style={{
100
- marginLeft: "auto",
101
- }}
102
- className="go-to"
103
- onClick={() => {
104
- if (typeof data.onClick === "function") {
105
- data.onClick();
106
- }
107
- }}
108
- >
109
- <CustomIcon height={14} width={14} name="LinkNewTab" />
110
- </div>
102
+ {!isPdf && (
103
+ <div
104
+ style={{
105
+ marginLeft: "auto",
106
+ }}
107
+ className="go-to"
108
+ onClick={() => {
109
+ if (typeof data.onClick === "function") {
110
+ data.onClick();
111
+ }
112
+ }}
113
+ >
114
+ <CustomIcon height={14} width={14} name="LinkNewTab" />
115
+ </div>
116
+ )}
111
117
  </div>
112
118
  </Style>
113
119
  <Handle
@@ -129,25 +135,28 @@ export default function NameNode({ data }) {
129
135
  }
130
136
 
131
137
  const Style = styled.div`
132
- width: ${NAME_CARD_WIDTH}px;
133
- display: flex;
134
- background: white;
135
- border-radius: 8px;
136
- box-shadow: 0px 3.76px 10.03px 0px #00000014;
137
- box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
138
- overflow: hidden;
139
- box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
138
+ width: ${NAME_CARD_WIDTH}px;
139
+ height: 55px;
140
+ display: flex;
141
+ background: white;
142
+ border-radius: 8px;
143
+ overflow: hidden;
144
+ box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
145
+ -webkit-print-color-adjust: exact;
146
+ print-color-adjust: exact;
140
147
 
141
- .left {
142
- width: 32px;
143
- background: red;
144
- border-top-left-radius: 12px;
145
- border-bottom-left-radius: 12px;
146
- }
148
+ .left {
149
+ width: 32px;
150
+ background: red;
151
+ border-top-left-radius: 12px;
152
+ border-bottom-left-radius: 12px;
153
+ }
147
154
 
148
- .right {
149
- padding: 16px 12px;
150
- width: 100%
151
- border-bottom: 1px solid var(--base-gray-30);
152
- }
153
- `;
155
+ .right {
156
+ padding: 0px 12px;
157
+ width: 100%;
158
+ display: flex;
159
+ align-items: center;
160
+ border-bottom: none;
161
+ }
162
+ `;
@@ -1,6 +1,7 @@
1
+ // components/Nodes/PrimaryNode.jsx
1
2
  import React from "react";
2
3
  import styled from "styled-components";
3
- import { Handle, Position } from "@xyflow/react"; //
4
+ import { Handle, Position } from "@xyflow/react";
4
5
  import CustomIcon from "../../../Icon/CustomIcon.jsx";
5
6
  import { Tooltip } from "antd";
6
7
  import PropTypes from "prop-types";
@@ -10,6 +11,7 @@ export const MAIN_NODE_WIDTH = 300;
10
11
  export const MAIN_NODE_HEIGHT = 150;
11
12
 
12
13
  export default function PrimaryNode({ id, data }) {
14
+ const isPdf = data?.isPdf; // Get isPdf from data prop
13
15
  return (
14
16
  <>
15
17
  <Handle
@@ -30,7 +32,7 @@ export default function PrimaryNode({ id, data }) {
30
32
  opacity: 0,
31
33
  }}
32
34
  />
33
- <Style className="flex">
35
+ <Style $isPdf={isPdf} className="flex"> {/* Pass isPdf to styled component */}
34
36
  <div
35
37
  className="left flex flex-column justify-center"
36
38
  style={{
@@ -68,7 +70,7 @@ export default function PrimaryNode({ id, data }) {
68
70
  {data?.name || ""}
69
71
  </span>
70
72
  </Tooltip>
71
- {data.onClick && (
73
+ {!data.isPdf && (
72
74
  <div
73
75
  className="go-to"
74
76
  onClick={() => {
@@ -133,13 +135,14 @@ export default function PrimaryNode({ id, data }) {
133
135
 
134
136
  const Style = styled.div`
135
137
  width: ${MAIN_NODE_WIDTH}px;
138
+ height: ${MAIN_NODE_HEIGHT}px; /* Explicitly set height */
136
139
  display: flex;
137
140
  background: white;
138
141
  border-radius: 8px;
139
- box-shadow: 0px 3.76px 10.03px 0px #00000014;
140
- box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
141
142
  overflow: hidden;
142
- box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
143
+ box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
144
+ -webkit-print-color-adjust: exact;
145
+ print-color-adjust: exact;
143
146
 
144
147
  .left {
145
148
  width: 32px;
@@ -233,5 +236,6 @@ PrimaryNode.propTypes = {
233
236
  backgroundColor: PropTypes.string,
234
237
  totalSources: PropTypes.number,
235
238
  onClick: PropTypes.func,
239
+ isPdf: PropTypes.bool,
236
240
  }),
237
- };
241
+ };
package/.env DELETED
@@ -1,8 +0,0 @@
1
- REACT_APP_API_KEY=
2
- REACT_APP_AUTH_DOMAIN=
3
- REACT_APP_PROJECT_ID=
4
- REACT_APP_STORAGE_BUCKED=
5
- REACT_APP_SENDER_ID=
6
- REACT_APP_APP_ID=
7
- REACT_APP_MEASUREMENT_ID=
8
- REACT_APP_VAPID_KEY=
@@ -1,13 +0,0 @@
1
- {
2
- "cSpell.words": ["cukura"],
3
- "files.autoSave": "afterDelay",
4
- "editor.wordWrap": "on",
5
- "editor.autoClosingBrackets": "always",
6
- "editor.autoClosingComments": "always",
7
- "editor.autoClosingQuotes": "always",
8
- "editor.defaultFormatter": "esbenp.prettier-vscode",
9
- "editor.formatOnPaste": true,
10
- "editor.formatOnSave": true,
11
- "notebook.defaultFormatter": "esbenp.prettier-vscode",
12
- "javascript.format.semicolons": "insert"
13
- }