code: def transform_ratio(value):
      """Transformation that takes ratios and applies a function that preserves equal distances to origin (1)
      for similar relationships, eg. a ratio of 2 (twice the size) is at the same distance of 1 (same size) as
      0.5 (half the size).
      Read: 'how many times larger or smaller than reference disparity'.
      """
      if value >= 1:
          return value - 1
      elif value == 0:
          return np.nan
      else:
          return 1 - 1 / value
  
file_path: aequitas/src/aequitas/plot/commons/helpers.py
imports: import altair
  import numpy
  from millify import millify, prettify
label_desc: Use image node_id 3 for calling a global function with example usage: transform_ratio(value) and returns: unknown, np, unknown