8c70513ed7f9764bed461a36662457ea535ede1ba8dc6782eeddf30215b5b37d0c6f4027029359d78e6d0bbe5284e9dee0ad96339abf40ee4151ea865ca29e 919 B

123456789101112131415161718192021222324252627
  1. export interface PrepareBoxplotDataOpt {
  2. boundIQR?: number | 'none';
  3. itemNameFormatter?: string | ((params: {
  4. value: number;
  5. }) => string);
  6. }
  7. /**
  8. * See:
  9. * <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>
  10. * <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>
  11. *
  12. * Helper method for preparing data.
  13. *
  14. * @param rawData like
  15. * [
  16. * [12,232,443], (raw data set for the first box)
  17. * [3843,5545,1232], (raw data set for the second box)
  18. * ...
  19. * ]
  20. * @param opt.boundIQR=1.5 Data less than min bound is outlier.
  21. * default 1.5, means Q1 - 1.5 * (Q3 - Q1).
  22. * If 'none'/0 passed, min bound will not be used.
  23. */
  24. export default function prepareBoxplotData(rawData: number[][], opt: PrepareBoxplotDataOpt): {
  25. boxData: (number | string)[][];
  26. outliers: (number | string)[][];
  27. };