Utilities

For basic functions

from parag.utils import get_src_path, display_plot, export_plot, get_colors
get_src_path(
    'parag'
    )
display_plot({
  # "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A simple bar chart with embedded data.",
  "data": {
    "values": [
      {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
      {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
      {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
    ]
  },
  "mark": "bar",
  "encoding": {
    "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
    "y": {"field": "b", "type": "quantitative"}
  }
}
)
get_colors(
    subsets=range(5),
    cmap_subsets=None,
    test=True,
    )
{0: '#0173b2', 1: '#de8f05', 2: '#029e73', 3: '#d55e00', 4: '#cc78bc'}