Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CSVDataSink<In>

CSVDataSink

Type parameters

  • In: DataFrame

Hierarchy

  • SinkNode<In>
    • CSVDataSink

Index

Constructors

constructor

  • new CSVDataSink<In>(file: string, header: { id: string; title: string }[], writeCallback: (frame: In) => any, options?: SinkNodeOptions): CSVDataSink<In>
  • Type parameters

    • In: DataFrame<In>

    Parameters

    • file: string
    • header: { id: string; title: string }[]
    • writeCallback: (frame: In) => any
        • (frame: In): any
        • Parameters

          • frame: In

          Returns any

    • Optional options: SinkNodeOptions

    Returns CSVDataSink<In>

Properties

graph

graph: GraphShape<any, any>

Graph shape

name

name: string

Name of the node. Does not have to be unique.

Protected options

options: SinkNodeOptions

uid

uid: string

Unique identifier of node.

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

inlets

  • get inlets(): Edge<In>[]
  • Get the incoming edges

    Returns Edge<In>[]

    Incoming edges

model

  • get model(): Model<any, any>
  • Graph this model is part of

    Returns Model<any, any>

    Positioning model

outlets

  • get outlets(): Edge<Out>[]
  • Get the outgoing edges

    Returns Edge<Out>[]

    Outgoing edges

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): CSVDataSink<In>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns CSVDataSink<In>

emit

  • emit(name: string | symbol, ...args: any[]): boolean
  • emit(event: "available"): boolean
  • emit(name: "completed", e: PushEvent): boolean
  • emit(name: "error", e: PushErrorEvent): boolean
  • emit(name: "ready"): boolean
  • emit(name: "destroy"): boolean
  • Parameters

    • name: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Emit available event

    Parameters

    • event: "available"

      available

    Returns boolean

  • Emit completed event

    Parameters

    • name: "completed"

      completed

    • e: PushEvent

    Returns boolean

  • Emit error

    Parameters

    • name: "error"

      error

    • e: PushErrorEvent

    Returns boolean

  • Node ready

    Parameters

    • name: "ready"

      ready

    Returns boolean

  • Destroy the node

    Parameters

    • name: "destroy"

      destroy

    Returns boolean

emitAsync

  • emitAsync(type: string | symbol, ...args: any[]): Promise<boolean>
  • Parameters

    • type: string | symbol
    • Rest ...args: any[]

    Returns Promise<boolean>

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

isAvailable

  • isAvailable(): boolean
  • Check if the node is available for accepting push requests

    Returns boolean

    Is the node available to push

isReady

  • isReady(): boolean
  • Returns boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

logger

  • logger(level: string, log: any): void
  • Graph logger

    Parameters

    • level: string

      Logging level

    • log: any

      Message

    Returns void

off

  • off(event: string | symbol, listener: (...args: any[]) => void): CSVDataSink<In>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns CSVDataSink<In>

on

  • on(name: string | symbol, listener: (...args: any[]) => void): CSVDataSink<In>
  • on(event: "available", listener: () => void | Promise<void>): CSVDataSink<In>
  • on(name: "completed", listener: (event: PushEvent) => void | Promise<void>): CSVDataSink<In>
  • on(name: "error", listener: (event: PushErrorEvent) => void | Promise<void>): CSVDataSink<In>
  • on(name: "pull", listener: (options?: PullOptions) => void | Promise<void>): CSVDataSink<In>
  • on(name: "push", listener: (frame: In, options?: PushOptions) => void | Promise<void>): CSVDataSink<In>
  • Parameters

    • name: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns CSVDataSink<In>

  • Event when a node is available

    Parameters

    • event: "available"

      available

    • listener: () => void | Promise<void>

      Event callback

        • (): void | Promise<void>
        • Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event when a push is completed

    Parameters

    • name: "completed"

      error

    • listener: (event: PushEvent) => void | Promise<void>

      Event callback

        • (event: PushEvent): void | Promise<void>
        • Parameters

          • event: PushEvent

          Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event when an error is triggered

    Parameters

    • name: "error"

      error

    • listener: (event: PushErrorEvent) => void | Promise<void>

      Error event callback

        • (event: PushErrorEvent): void | Promise<void>
        • Parameters

          • event: PushErrorEvent

          Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event when a data frame is pulled

    Parameters

    • name: "pull"

      receive

    • listener: (options?: PullOptions) => void | Promise<void>

      Event callback

        • (options?: PullOptions): void | Promise<void>
        • Parameters

          • Optional options: PullOptions

          Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event when a data frame is push to the node

    Parameters

    • name: "push"

      receive

    • listener: (frame: In, options?: PushOptions) => void | Promise<void>

      Event callback

        • (frame: In, options?: PushOptions): void | Promise<void>
        • Parameters

          • frame: In
          • Optional options: PushOptions

          Returns void | Promise<void>

    Returns CSVDataSink<In>

onPush

  • onPush(data: In): Promise<void>

once

  • once(name: string | symbol, listener: (...args: any[]) => void): CSVDataSink<In>
  • once(event: "available", listener: () => void | Promise<void>): CSVDataSink<In>
  • once(name: "completed", listener: (event: PushEvent) => void | Promise<void>): CSVDataSink<In>
  • once(name: "destroy", listener: () => void | Promise<void>): CSVDataSink<In>
  • once(name: "build", listener: (builder: GraphBuilder<DataFrame, DataFrame>) => void | Promise<void>): CSVDataSink<In>
  • once(name: "ready", listener: () => void | Promise<void>): CSVDataSink<In>
  • Parameters

    • name: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns CSVDataSink<In>

  • Event when a node is available

    Parameters

    • event: "available"

      available

    • listener: () => void | Promise<void>

      Event callback

        • (): void | Promise<void>
        • Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event when a push is completed

    Parameters

    • name: "completed"

      error

    • listener: (event: PushEvent) => void | Promise<void>

      Event callback

        • (event: PushEvent): void | Promise<void>
        • Parameters

          • event: PushEvent

          Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event called when node is destroyed

    Parameters

    • name: "destroy"

      destroy

    • listener: () => void | Promise<void>

      Event callback

        • (): void | Promise<void>
        • Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event called when node is build

    Parameters

    • name: "build"

      build

    • listener: (builder: GraphBuilder<DataFrame, DataFrame>) => void | Promise<void>

      Event callback

        • (builder: GraphBuilder<DataFrame, DataFrame>): void | Promise<void>
        • Parameters

          • builder: GraphBuilder<DataFrame, DataFrame>

          Returns void | Promise<void>

    Returns CSVDataSink<In>

  • Event called when node is ready

    Parameters

    • name: "ready"

      ready

    • listener: () => void | Promise<void>

      Event callback

        • (): void | Promise<void>
        • Returns void | Promise<void>

    Returns CSVDataSink<In>

onceAvailable

  • onceAvailable(): Promise<void>
  • Promise once the node is available

    Returns Promise<void>

    Promise when the node is available

onceCompleted

  • onceCompleted(frameUID: string): Promise<PushEvent>
  • Promise once the frame is completed

    Parameters

    • frameUID: string

      Frame UID

    Returns Promise<PushEvent>

    Promise when the frame is completed

Protected persistDataObject

  • persistDataObject(frame: In): Promise<void>
  • Parameters

    • frame: In

    Returns Promise<void>

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): CSVDataSink<In>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns CSVDataSink<In>

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): CSVDataSink<In>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns CSVDataSink<In>

pull

  • pull(options?: PullOptions): Promise<void>
  • Send a pull request to the node

    Parameters

    • Optional options: PullOptions

    Returns Promise<void>

    Pull promise

push

  • push(data: In | In[], options?: PushOptions): Promise<void>
  • Parameters

    • data: In | In[]
    • Optional options: PushOptions

    Returns Promise<void>

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): CSVDataSink<In>
  • Parameters

    • Optional event: string | symbol

    Returns CSVDataSink<In>

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): CSVDataSink<In>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns CSVDataSink<In>

setMaxListeners

  • Parameters

    • n: number

    Returns CSVDataSink<In>

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number