code: def from_json(
      value, output_type="Figure", skip_invalid=False, engine=None
  ):
      """
      Construct a figure from a JSON string
  
      Parameters
      ----------
      value: str or bytes
          String or bytes object containing the JSON representation of a figure
  
      output_type: type or str (default 'Figure')
          The output figure type or type name.
          One of:  graph_objs.Figure, 'Figure', graph_objs.FigureWidget, 'FigureWidget'
  
      skip_invalid: bool (default False)
          False if invalid figure properties should result in an exception.
          True if invalid figure properties should be silently ignored.
  
      engine: str (default None)
          The JSON decoding engine to use. One of:
            - if "json", parse JSON using built in json module
            - if "orjson", parse using the faster orjson module, requires the orjson
              package
            - if "auto" use orjson module if available, otherwise use the json module
  
          If not specified, the default engine is set to the current value of
          plotly.io.json.config.default_engine.
  
      Raises
      ------
      ValueError
          if value is not a string, or if skip_invalid=False and value contains
          invalid figure properties
  
      Returns
      -------
      Figure or FigureWidget
      """
  
      # Decode JSON
      # -----------
      fig_dict = from_json_plotly(value, engine=engine)
  
      # Validate coerce output type
      # ---------------------------
      cls = validate_coerce_output_type(output_type)
  
      # Create and return figure
      # ------------------------
      fig = cls(fig_dict, skip_invalid=skip_invalid)
      return fig
  
imports: import json
  import decimal
  import datetime
  import warnings
  from pathlib import Path
  from plotly.io._utils import validate_coerce_fig_to_dict, validate_coerce_output_type
  from _plotly_utils.optional_imports import get_module
  from _plotly_utils.basevalidators import ImageUriValidator
label_desc: Use image node_id 7 for calling a global function with example usage: from_json(value, output_type, skip_invalid, engine) and returns: fig