classDiagram
class MenuProp {
  <<interface>>
  name: string
  icon: any
  component: any
  needsReport?: boolean
  openedOnMobile?: boolean
}



class GenericContainerProps {
  <<interface>>
  element?: any
  xxxl?: boolean
  xxl?: boolean
  xl?: boolean
  lg?: boolean
  sm?: boolean
  full?: boolean
  horizontal?: boolean
  vertical?: boolean
  rounded?: boolean
  colorless?: boolean
  transparent?: boolean
  primary?: boolean
  secondary?: boolean
  tertiary?: boolean
  black?: boolean
  red?: boolean
  orange?: boolean
  amber?: boolean
  yellow?: boolean
  lime?: boolean
  green?: boolean
  emerald?: boolean
  teal?: boolean
  cyan?: boolean
  sky?: boolean
  blue?: boolean
  indigo?: boolean
  violet?: boolean
  purple?: boolean
  fuchsia?: boolean
  pink?: boolean
  rose?: boolean
  clickable?: boolean
  focusable?: boolean
  disabled?: boolean
  svg?: any
  leftSvg?: any
  rightSvg?: any
  src?: string
  leftSrc?: string
  rightSrc?: string
  containerClasses?: string
  illustrationClasses?: string
  leftIllustrationClasses?: string
  rightIllustrationClasses?: string
}



class GenericIllustrationProps {
  <<interface>>
  right?: boolean
}

GenericContainerProps <|-- GenericIllustrationProps

class Color {
  <<type>>
  | 'black'   | 'white'   | 'gray'   | 'red'   | 'orange'   | 'amber'   | 'yellow'   | 'lime'   | 'green'   | 'emerald'   | 'teal'   | 'cyan'   | 'sky'   | 'blue'   | 'indigo'   | 'violet'   | 'purple'   | 'fuchsia'   | 'pink'   | 'rose'
}



class MathNumberObject {
  <<interface>>
  [key: string]: MathNumber | MathNumber[] | MathNumber[][]
}
MathNumberObject <.. MathNumber


class ComputedData {
  <<interface>>
  raw: MathNumberObject
  parameters: MathNumberObject
  computed: MathNumberObject
  compute: #40;#41; =#62; void
}
ComputedData <.. MathNumberObject


class DataLabel {
  <<interface>>
  name: string
  unit: MathUnit
}
DataLabel <.. MathUnit


class DataValue {
  <<interface>>
  label: DataLabel
  value: MathNumber | MathNumber[] | MathNumber[][]
}
DataValue <.. DataLabel
DataValue <.. MathNumber


class BaseDrop {
  <<interface>>
  data: ComputedData
  additionnalFields: MachineField[]
}
BaseDrop <.. ComputedData


class JSONDrop {
  <<interface>>

}



class BaseField {
  <<interface>>
  label: string
  value: | boolean     | number     | string     | SlidableNumber     | DateValue     | LongString     | SelectableString
}
BaseField <.. SlidableNumber
BaseField <.. DateValue
BaseField <.. LongString
BaseField <.. SelectableString


class JSONField {
  <<interface>>
  label: string
  value: boolean | number | string
}



class SlidableNumber {
  <<interface>>
  kind: 'slidableNumber'
  value: number
  step: number
  min: number
  max: number
}



class DateValue {
  <<interface>>
  kind: 'date'
  value: string
}



class LongString {
  <<interface>>
  kind: 'longString'
  value: string
}



class SelectableString {
  <<interface>>
  kind: 'selectableString'
  value: string
  possibleValues: string[]
  strict: boolean
}



class Icon {
  <<interface>>
  element: HTMLElement
  color: string
  setText: #40;text: string#41; =#62; void
  setIcon: #40;iconName: IconName#41; =#62; void
}



class IconName {
  <<type>>
  | 'circle'   | 'triangle'   | 'square'   | 'rhombus'   | 'flare'   | 'pentagon'   | 'hexagon'   | 'hexagonAlt'   | 'heptagon'   | 'octagon'
}



class Image {
  <<interface>>
  id: string
  sourceData: mapboxgl.ImageSourceRaw
  markerNW: mapboxgl.Marker
  markerSE: mapboxgl.Marker
  opacity: number
  addToMap: #40;isVisible: boolean#41; =#62; void
  remove: #40;#41; =#62; void
}



class JSONImage {
  <<interface>>
  name: string
  opacity?: number
  coordinates?: #123;     nw: LngLat     se: LngLat   #125;
}
JSONImage <.. LngLat


class ImageCoordinates {
  <<interface>>
  tl: XYCoord
  tr: XYCoord
  bl: XYCoord
  br: XYCoord
}
ImageCoordinates <.. XYCoord


class Line {
  <<interface>>
  addToMap: #40;#41; =#62; void
  update: #40;#41; =#62; void
  remove: #40;#41; =#62; void
}



class MathNumber {
  <<interface>>
  value: math.Unit | number
  unit: MathUnit | string
  displayString: string
  displayStringWithUnit: string
  toDisplayedValue: #40;#41; =#62; void
}
MathNumber <.. MathUnit


class MathUnit {
  <<interface>>
  name: string
  currentUnit: string
  currentPrecision: number
  possibleSettings: [string, number][]
  possiblePrecisions: number[]
  minDisplayedValue?: number
  maxDisplayedValue?: number
  thresholds?: #123;     selected: PredefinedThreshold | CustomThreshold | null     list: PredefinedThreshold[]     // custom: CustomThreshold   #125;
}
MathUnit <.. PredefinedThreshold
MathUnit <.. CustomThreshold


class BasePoint {
  <<interface>>
  machine: MachineName
  number: number
  marker: mapboxgl.Marker
  icon: Icon
  settings: JSONPointSettings
  zone: Zone | null
  data: DataValue[]
  updateText: #40;#41; =#62; void
  updateVisibility: #40;#41; =#62; void
  addToMap: #40;#41; =#62; void
  remove: #40;#41; =#62; void
}
BasePoint <.. Icon
BasePoint <.. JSONPointSettings
BasePoint <.. Zone
BasePoint <.. DataValue


class BasePointCreatorParameters {
  <<interface>>
  machine: MachineName
}



class JSONPoint {
  <<interface>>
  coordinates: mapboxgl.LngLatLike
  settings: JSONPointSettings
  informations: JSONField[]
  drops: JSONDrop[]
}
JSONPoint <.. JSONPointSettings
JSONPoint <.. JSONField
JSONPoint <.. JSONDrop


class JSONPointSettings {
  <<interface>>
  isVisible: boolean
}



class BaseProject {
  <<interface>>
  machine: MachineName
  name: MachineField
  informations: MachineField[]
  reports: SelectableList#60;MachineReport#62;
  units: MachineUnits
  settings: JSONProjectSettings
  images: Image[]
  refreshLinesAndImages: #40;#41; =#62; void
  setMapStyle: #40;styleIndex: number#41; =#62; void
  fitOnMap: #40;#41; =#62; void
  addToMap: #40;#41; =#62; void
  remove: #40;#41; =#62; void
}
BaseProject <.. JSONProjectSettings
BaseProject <.. Image


class BaseProjectCreatorParameters {
  <<interface>>
  machine: MachineName
  units: MachineUnits
}



class JSONProject {
  <<interface>>
  name: string
  machine: MachineName
  selectedReport?: number
  settings: JSONProjectSettings
  images: JSONImage[]
  informations: JSONField[]
  reports: JSONReport[]
  units: JSONUnits
}
JSONProject <.. JSONProjectSettings
JSONProject <.. JSONImage
JSONProject <.. JSONField
JSONProject <.. JSONReport
JSONProject <.. JSONUnits


class JSONProjectSettings {
  <<interface>>
  arePointsVisible: boolean
  arePointsLinked: boolean
  arePointsLocked: boolean
  areImagesVisible: boolean
  pointsState: PointsState
  map: #123;     styleIndex: number     coordinates?: LngLat     zoom?: number   #125;
}
JSONProjectSettings <.. PointsState
JSONProjectSettings <.. LngLat


class PointsState {
  <<type>>
  'value' | 'number' | 'nothing'
}



class JSONUnits {
  <<type>>
  JSONHeavydynUnits | JSONMaxidynUnits | JSONMinidynUnits
}



class BaseReport {
  <<interface>>
  machine: MachineName
  name: MachineField
  points: MachinePoint[]
  line: Line
  zones: Zone[]
  screenshots: string[]
  dataLabels: ReportDataLabels
  settings: JSONReportSettings
  platform: MachineField[]
  informations: MachineField[]
  isOnMap: boolean
  fitOnMap: #40;#41; =#62; void
  addToMap: #40;#41; =#62; void
  remove: #40;#41; =#62; void
}
BaseReport <.. Line
BaseReport <.. Zone
BaseReport <.. ReportDataLabels
BaseReport <.. JSONReportSettings


class ReportDataLabels {
  <<interface>>
  groups: SelectableList#60;GroupedDataLabels#62;
  table: SelectableList#60;TableDataLabelsParameters#62;
}
ReportDataLabels <.. GroupedDataLabels
ReportDataLabels <.. TableDataLabelsParameters


class GroupedDataLabels {
  <<interface>>
  from: DataLabelsFrom
  choices: SelectableList#60;DataLabel#62;
  indexes?: SelectableList#60;MachineDropIndex#62;
}
GroupedDataLabels <.. DataLabelsFrom
GroupedDataLabels <.. DataLabel


class TableDataLabelsParameters {
  <<interface>>
  group: GroupedDataLabels
  index?: MachineDropIndex
  dataLabels: DataLabel[]
}
TableDataLabelsParameters <.. GroupedDataLabels
TableDataLabelsParameters <.. DataLabel


class BaseReportCreatorParameters {
  <<interface>>
  machine: MachineName
  groupedDataLabels: SelectableList#60;GroupedDataLabels#62;
}
BaseReportCreatorParameters <.. GroupedDataLabels


class JSONReport {
  <<interface>>
  name: string
  points: JSONPoint[]
  dataLabels: JSONReportDataLabels
  zones: JSONZone[]
  settings: JSONReportSettings
  screenshots: number[]
  platform: JSONField[]
  informations: JSONField[]
}
JSONReport <.. JSONPoint
JSONReport <.. JSONReportDataLabels
JSONReport <.. JSONZone
JSONReport <.. JSONReportSettings
JSONReport <.. JSONField


class JSONReportDataLabels {
  <<interface>>
  groups: SelectableList#60;number, JSONGroupedDataLabels#62;
  table: SelectableList#60;number, JSONTableDataLabelsParameters#62;
}
JSONReportDataLabels <.. JSONGroupedDataLabels
JSONReportDataLabels <.. JSONTableDataLabelsParameters


class JSONGroupedDataLabels {
  <<interface>>
  from: DataLabelsFrom
  choices: SelectableOptionalList#60;number, string#62;
  indexes?: SelectableList#60;number, MachineDropIndex#62;
}
JSONGroupedDataLabels <.. DataLabelsFrom


class JSONTableDataLabelsParameters {
  <<interface>>
  from: DataLabelsFrom
  index?: number
  dataLabels: string[]
}
JSONTableDataLabelsParameters <.. DataLabelsFrom


class DataLabelsFrom {
  <<type>>
  'Drop' | 'Test' | 'Zone'
}



class JSONReportSettings {
  <<interface>>
  iconName: IconName
  isVisible: boolean
  selectedColorization: 'Threshold' | 'Zone'
  threshold: #123;     colors: ThresholdColors     custom: #123;#125;   #125;
}
JSONReportSettings <.. IconName
JSONReportSettings <.. ThresholdColors


class ThresholdColors {
  <<interface>>
  low: Color
  middle: Color
  high: Color
}
ThresholdColors <.. Color


class BaseDropIndex {
  <<interface>>
  machine: MachineName
  type: string
  displayedIndex: number
}



class CustomThreshold {
  <<interface>>
  name: string
  value: number
}



class PredefinedThreshold {
  <<interface>>
  name: string
  value: number
}



class WatcherHandler {
  <<interface>>
  add: #40;stop: #40;#41; =#62; void#41; =#62; void
  remove: #40;stop: #40;#41; =#62; void#41; =#62; void
  clean: #40;#41; =#62; void
}



class Zone {
  <<interface>>
  name: string
  color: Color
}
Zone <.. Color


class JSONZone {
  <<interface>>
  name: string
  color?: Color
}
JSONZone <.. Color


class LngLat {
  <<interface>>
  lng: number
  lat: number
}



class XYCoord {
  <<interface>>
  x: number
  y: number
}



class SelectableList~S, L~ {
  <<interface>>
  selected: S | null
  list: L[]
}



class SelectableOptionalList~S, L~ {
  <<interface>>
  selected: S | null
  list?: L[]
}



class DeepRequired~T~ {
  <<type>>
  #123;   [K in keyof T]: Required#60;DeepRequired#60;T[K]#62;#62; #125;
}



class Store {
  <<interface>>
  projects: SelectableList#60;MachineProject#62;
  map: mapboxgl.Map | null
  save: #40;key: StoreKeys, value: StoreSaveableTypes#41; =#62; void
}



class StoreKeys {
  <<type>>
  Exclude#60;keyof Store, 'save'#62;
}
StoreKeys <.. Store


class StoreTypes {
  <<type>>
  Store[keyof Store]
}
StoreTypes <.. Store


class StoreSaveableTypes {
  <<type>>
  Extract#60;   StoreTypes,   string[] | number[] | boolean[] | string | number | boolean | null #62;
}
StoreSaveableTypes <.. StoreTypes


