( kind: Kind, points: DataPoint[], xCellId?: Id, yCellId?: Id, yLabel?: string, )
| 302 | ]; |
| 303 | |
| 304 | export const getSeriesSummary = ( |
| 305 | kind: Kind, |
| 306 | points: DataPoint[], |
| 307 | xCellId?: Id, |
| 308 | yCellId?: Id, |
| 309 | yLabel?: string, |
| 310 | ): SeriesSummary => { |
| 311 | const [xMin, xMax, yMin, yMax] = getBounds(kind, points); |
| 312 | const xValues: XValue[] = []; |
| 313 | const continuousX = |
| 314 | kind == LINE && |
| 315 | arrayIsEmpty(arrayFilter(points, ([, xValue]) => !isNumber(xValue))); |
| 316 | |
| 317 | arrayForEach(points, ([, xValue]) => { |
| 318 | if (!arrayHas(xValues, xValue)) { |
| 319 | arrayPush(xValues, xValue); |
| 320 | } |
| 321 | }); |
| 322 | |
| 323 | return { |
| 324 | continuousX, |
| 325 | xCellId, |
| 326 | xMin, |
| 327 | xMax, |
| 328 | yMin, |
| 329 | yMax, |
| 330 | yCellId, |
| 331 | yLabel, |
| 332 | xValues, |
| 333 | }; |
| 334 | }; |
| 335 | |
| 336 | export const getDomainState = (summaries: SeriesSummary[]): DomainState => { |
| 337 | const xValues: XValue[] = []; |
no test coverage detected
searching dependent graphs…