code: def bar(h1: Histogram1D, **kwargs) -> dict:
      
      # TODO: Enable collections
      # TODO: Enable legend
  
      vega = _create_figure(kwargs)
      _add_title(h1, vega, kwargs)
      _create_scales(h1, vega, kwargs)
      _create_axes(h1, vega, kwargs)
  
      data = get_data(h1, kwargs.pop("density", None), kwargs.pop("cumulative", None)).tolist()
      lefts = h1.bin_left_edges.astype(float).tolist()
      rights = h1.bin_right_edges.astype(float).tolist()
  
      vega["data"] = [{
          "name": "table",
          "values": [{
                  "x": lefts[i],
                  "x2": rights[i],
                  "y": data[i],
              }
              for i in range(h1.bin_count)
          ]
      }]
  
      alpha = kwargs.pop("alpha", 1)
      # hover_alpha = kwargs.pop("hover_alpha", alpha)
  
      vega["marks"] = [
          {
              "type": "rect",
              "from": {"data": "table"},
              "encode": {
                  "enter": {
                      "x": {"scale": "xscale", "field": "x"},
                      "x2": {"scale": "xscale", "field": "x2"},
                      "y": {"scale": "yscale", "value": 0},
                      "y2": {"scale": "yscale", "field": "y"},
                      # "stroke": {"scale": "color", "field": "c"},
                      "strokeWidth": {"value": kwargs.pop("lw", 2)}
                  },
                  "update": {
                      "fillOpacity": [
                          # {"test": "datum === tooltip", "value": hover_alpha},
                          {"value": alpha}
                      ]
                  },
              }
          }
      ]
      _create_tooltips(h1, vega, kwargs)
  
      return vega
docs: Bar plot of 1D histogram.
  
      Parameters
      ----------
      lw : float
          Width of the line between bars
      alpha : float
          Opacity of the bars
      hover_alpha: float
          Opacity of the bars when hover on