@opentrace/components 0.1.1-rc.62 → 0.1.1-rc.66

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.
@@ -5605,9 +5605,10 @@ function useGraphInstance({
5605
5605
  const unmountedRef = t.useRef(false);
5606
5606
  const requestIdRef = t.useRef(0);
5607
5607
  const [layoutReady, setLayoutReady] = t.useState(false);
5608
+ const flatMode = layoutConfig.flatMode ?? false;
5608
5609
  const structuralTypes = t.useMemo(
5609
- () => new Set(layoutConfig.structuralTypes),
5610
- [layoutConfig.structuralTypes]
5610
+ () => flatMode ? /* @__PURE__ */ new Set() : new Set(layoutConfig.structuralTypes),
5611
+ [layoutConfig.structuralTypes, flatMode]
5611
5612
  );
5612
5613
  t.useEffect(() => {
5613
5614
  graph.clear();
@@ -5671,7 +5672,7 @@ function useGraphInstance({
5671
5672
  });
5672
5673
  }
5673
5674
  const { assignments: communityAssignments } = communityData;
5674
- if (communityAssignments) {
5675
+ if (communityAssignments && !flatMode) {
5675
5676
  const communityGroups = /* @__PURE__ */ new Map();
5676
5677
  for (const node of allNodes) {
5677
5678
  const cid = communityAssignments[node.id];
@@ -5719,7 +5720,7 @@ function useGraphInstance({
5719
5720
  const nodeIds = allNodes.map((n2) => n2.id);
5720
5721
  const simLinks = [];
5721
5722
  for (const link of allLinks) {
5722
- if (link.label !== layoutConfig.layoutEdgeType) continue;
5723
+ if (!flatMode && link.label !== layoutConfig.layoutEdgeType) continue;
5723
5724
  const source = endpointId(link.source);
5724
5725
  const target = endpointId(link.target);
5725
5726
  if (nodeIdSet.has(source) && nodeIdSet.has(target)) {
@@ -5760,7 +5761,7 @@ function useGraphInstance({
5760
5761
  console.log(`[graph] layout computed for ${pos.size} nodes`);
5761
5762
  }
5762
5763
  const { assignments: assignments2 } = communityData;
5763
- if (assignments2 && Object.keys(assignments2).length > 0) {
5764
+ if (!flatMode && assignments2 && Object.keys(assignments2).length > 0) {
5764
5765
  applySpacing(pos, assignments2, 40, 100, 50, 0.5);
5765
5766
  const sizeMap = /* @__PURE__ */ new Map();
5766
5767
  for (const sn of serializedNodes) {