class_docstr: Reads an svg file and exports paths to a JSON format.
  
  Only segments and Bezier curves are supported
docstr: Export the svg paths into json.
  
  The json format looks like this:
  {
    "paths": [
      {
        "edgecolor": "#b3b3b3",
        "linewidth": 3.03045774,
        "id": "path3943",
        "items": [
          {
            "pts": [
              [ 571.83955, 751.5887290000001 ],
              [ 571.57463, 750.8480390000001 ],
              [ 571.44965, 747.969189 ],
              [ 571.56178, 745.191269 ]
            ],
            "type": "bezier"
          },
          {
            "pts": [
              [ 566.41278, 705.415739 ],
              [ 566.7642900000001, 696.532339 ]
            ],
            "type": "segment"
          },
          .
          .
          .
        ]
      },
      .
      .
      .
    ],
    "metadata": {
      "bounds": [
        1.3884929999999542, 398.60061299999995,
        -0.9977599999999711, 490.82066700000007
      ]
    }
  }
code: def to_json(self):
      """Export the svg paths into json.
  
      The json format looks like this:
      {
        "paths": [
          {
            "edgecolor": "#b3b3b3",
            "linewidth": 3.03045774,
            "id": "path3943",
            "items": [
              {
                "pts": [
                  [ 571.83955, 751.5887290000001 ],
                  [ 571.57463, 750.8480390000001 ],
                  [ 571.44965, 747.969189 ],
                  [ 571.56178, 745.191269 ]
                ],
                "type": "bezier"
              },
              {
                "pts": [
                  [ 566.41278, 705.415739 ],
                  [ 566.7642900000001, 696.532339 ]
                ],
                "type": "segment"
              },
              .
              .
              .
            ]
          },
          .
          .
          .
        ],
        "metadata": {
          "bounds": [
            1.3884929999999542, 398.60061299999995,
            -0.9977599999999711, 490.82066700000007
          ]
        }
      }
      """
      paths = self._get_paths()
      bounds = self._get_bounds(paths)
      metadata = {"bounds": bounds}
      result = {"metadata": metadata, "paths": paths}
  
      return json.dumps(result, indent=2, separators=(",", ": "))
  
file_path: nilearn/nilearn/plotting/glass_brain_files/svg_to_json_converter.py
imports: import json
  import re
  import sys
label_desc: Use image node_id 6 for calling the SVGToJSONConverter obj's underlying member method code with example usage: obj.to_json() and returns: json