code: def mesh_to_plotly(mesh):
      """Convert a :term:`mesh` to plotly format."""
      mesh = surface.load_surf_mesh(mesh)
      x, y, z = map(encode, np.asarray(mesh[0].T, dtype="<f4"))
      i, j, k = map(encode, np.asarray(mesh[1].T, dtype="<i4"))
      info = {
          "_x": x,
          "_y": y,
          "_z": z,
          "_i": i,
          "_j": j,
          "_k": k,
      }
      return info
  
file_path: nilearn/nilearn/plotting/js_plotting_utils.py
imports: import base64
  import os
  import warnings
  from string import Template
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from nilearn.plotting.html_document import HTMLDocument, set_max_img_views_before_warning
  from ..None import surface
  from .._utils.extmath import fast_abs_percentile
  from .._utils.param_validation import check_threshold
label_desc: Use image node_id 6 for calling a global function with example usage: mesh_to_plotly(mesh) and returns: info