code: def _build_base_change_chart(data):
      """Create the base change chart."""
      width = 100
      height = 200
      placeholder_width = (
          4 * width
      ) + 80  # 4 charts, plus constant spacing
      title = "Biallelic base changes from reference"
      base_change_data = pd.DataFrame(
          data, columns=["ref", "alt", "count"]
      )
  
      base_change_chart = _placeholder_for_empty_chart(
          "No biallelic SNPs",
          width=placeholder_width,
          height=height,
          title=title,
      )
      if not base_change_data.empty:
          bars = (
              alt.Chart(base_change_data)
              .mark_bar()
              .encode(
                  x=alt.X("alt", title="to alt"),
                  y=alt.Y(
                      "count", title="Count", axis=alt.Axis(format="s")
                  ),
                  color=alt.Color(
                      "alt",
                      legend=None,
                      sort=BASES,
                      scale=alt.Scale(
                          scheme="category20", domain=BASES
                      ),
                  ),
                  tooltip=alt.Tooltip("count", format=".4s"),
              )
          )
          labels = bars.mark_text(dy=-5, fontWeight="bold").encode(
              text="alt"
          )
  
          base_change_chart = (
              (bars + labels)
              .properties(width=100, height=200)
              .facet(column=alt.Column("ref", title=title, sort=BASES))
          )
  
      return base_change_chart
  
imports: import io
  import json
  import os
  import altair
  import numpy
  import pandas
  import tensorflow
label_desc: Use image node_id 8 for calling a global function with example usage: _build_base_change_chart(data) and returns: base_change_chart