class_docstr: Plot a group of elements in a grid layout based on a GridSpace element
  object.
class_docstr_tok: ["Plot","a","group","of","elements","in","a","grid","layout","based","on","a","GridSpace","element","object","."]
code: def _get_size(self, width, height):
      max_dim = max(self.layout.shape)
      # Reduce plot size as GridSpace gets larger
      shape_factor = 1.0 / max_dim
      # Expand small grids to a sensible viewing size
      expand_factor = 1 + (max_dim - 1) * 0.1
      scale_factor = expand_factor * shape_factor
      cols, rows = self.layout.shape
      return (scale_factor * cols * width, scale_factor * rows * height)
  
imports: import param
  from holoviews.plotting.util import attach_streams
  from ...core import AdjointLayout, Empty, GridMatrix, GridSpace, HoloMap, NdLayout
  from ...core.options import Store
  from ...core.util import wrap_tuple
  from ...element import Histogram
  from ..plot import CallbackPlot, DimensionedPlot, GenericAdjointLayoutPlot, GenericCompositePlot, GenericElementPlot, GenericLayoutPlot
  from .util import configure_matching_axes_from_dims, figure_grid
label_desc: Use image node_id 4 for calling the GridPlot obj's underlying member method code with example usage: obj._get_size(width, height) and returns: unknown,  unknown