@industry-theme/file-city-panel 0.2.0 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAuBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAYpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AA+rCD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA4BxC,CAAC"}
1
+ {"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAuBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAYpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AA2sCD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA4BxC,CAAC"}
@@ -14618,6 +14618,7 @@ const CodeCityPanelContent = ({
14618
14618
  resizeObserver.observe(container);
14619
14619
  return () => resizeObserver.disconnect();
14620
14620
  }, []);
14621
+ const LEGEND_MIN_SIZE = 200;
14621
14622
  const layout = useMemo(() => {
14622
14623
  if (!containerSize) {
14623
14624
  return { minMapSize: 0, legendPosition: "bottom", legendMaxSize: 0 };
@@ -14625,12 +14626,16 @@ const CodeCityPanelContent = ({
14625
14626
  const { width, height } = containerSize;
14626
14627
  const isLandscape = width > height;
14627
14628
  if (isLandscape) {
14628
- const minMapSize = height;
14629
- const legendMaxSize = width - minMapSize;
14629
+ const idealMapSize = height;
14630
+ const availableForLegend = width - idealMapSize;
14631
+ const legendMaxSize = Math.max(availableForLegend, LEGEND_MIN_SIZE);
14632
+ const minMapSize = width - legendMaxSize;
14630
14633
  return { minMapSize, legendPosition: "right", legendMaxSize };
14631
14634
  } else {
14632
- const minMapSize = width;
14633
- const legendMaxSize = height - minMapSize;
14635
+ const idealMapSize = width;
14636
+ const availableForLegend = height - idealMapSize;
14637
+ const legendMaxSize = Math.max(availableForLegend, LEGEND_MIN_SIZE);
14638
+ const minMapSize = height - legendMaxSize;
14634
14639
  return { minMapSize, legendPosition: "bottom", legendMaxSize };
14635
14640
  }
14636
14641
  }, [containerSize]);