@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
19 lines (17 loc) • 507 B
text/typescript
/* eslint-disable id-length */
import { UiFlowRunHistory } from '@/models/UiFlowRunHistory'
import { MapFunction } from '@/services/Mapper'
type ScatterPlotItem = {
id: string,
x: Date,
y: number,
itemClass?: string,
}
export const mapUiFlowRunHistoryToScatterPlotItem: MapFunction<UiFlowRunHistory, ScatterPlotItem> = function(source) {
return {
id: source.id,
x: source.timestamp,
y: source.duration,
itemClass: `scatter-plot-item scatter-plot-item--${source.stateType}`,
}
}