shareOf method

double shareOf(
  1. String component
)

The share of the document one component takes, from 0 to 1.

Implementation

double shareOf(String component) =>
    total == 0 ? 0 : (byComponent[component] ?? 0) / total;