Skip to content

Rework get Domain #223

@tizayi

Description

@tizayi

Rethink how the domain for the plot is calculated.

// Re think in future
export const getDomain = (
  detector: PlotRectangle,
): { xAxis: NumericRange; yAxis: NumericRange } => {
  const maxAxis = Math.max(detector.upperBound.x, detector.upperBound.y);
  const minAxis = Math.min(detector.lowerBound.x, detector.lowerBound.y);
  const offset = 0.2 * (maxAxis - minAxis);
  const range = new NumericRange(
    Math.round(minAxis - offset),
    Math.round(maxAxis + offset),
  );
  return { xAxis: range, yAxis: range };
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions