code: def _hexagons_to_geojson(hexagons_lats, hexagons_lons, ids=None):
      """
      Creates a geojson of hexagonal features based on the outputs of
      _compute_wgs84_hexbin
      """
      features = []
      if ids is None:
          ids = np.arange(len(hexagons_lats))
      for lat, lon, idx in zip(hexagons_lats, hexagons_lons, ids):
          points = np.array([lon, lat]).T.tolist()
          points.append(points[0])
          features.append(
              dict(
                  type="Feature",
                  id=idx,
                  geometry=dict(type="Polygon", coordinates=[points]),
              )
          )
      return dict(type="FeatureCollection", features=features)
  
file_path: catboost/contrib/python/plotly/py3/plotly/figure_factory/_hexbin_mapbox.py
imports: from plotly.express._core import build_dataframe
  from plotly.express._doc import make_docstring
  from plotly.express._chart_types import choropleth_mapbox, scatter_mapbox
  import numpy
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: _hexagons_to_geojson(hexagons_lats, hexagons_lons, ids) and returns: dict