How to use the noflo.Component function in noflo

To help you get started, we’ve selected a few noflo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rapid-sensemaking-framework / noflo-rsf / ts-components / CollectResponses.ts View on Github external
const getComponent = (): NofloComponent => {
  const c: NofloComponent = new noflo.Component()

  /* META */
  c.description = 'For a prompt, collect statements numbering up to a given maximum (or unlimited) from a list of participants'
  c.icon = 'compress'

  /* IN PORTS */
  c.inPorts.add('max_responses', {
    datatype: 'all', // string or number
    description: 'the number of responses to stop collecting at, use "*" for any amount',
    required: true
  })
  c.inPorts.add('max_time', {
    datatype: 'int',
    description: 'the number of seconds to wait until stopping this process automatically',
    required: true
  })
github samtecspg / articulate / api / components / domain.find-by-id.js View on Github external
exports.getComponent = () => {

    const c = new NoFlo.Component();
    c.description = 'Get domain by id';
    c.icon = 'user';
    c.inPorts.add(PORT_IN, {
        datatype: 'object',
        description: 'Object with all parsed values.'
    });

    c.inPorts.add(PORT_REDIS, {
        datatype: 'object',
        description: 'Redis client'
    });

    c.outPorts.add(PORT_OUT, {
        datatype: 'object'
    });
github rapid-sensemaking-framework / noflo-rsf / components / FormatPairwiseVoteList.js View on Github external
var getComponent = function () {
    var c = new noflo.Component();
    c.description = 'Format a list of pairwise votes to a single string message';
    c.icon = 'compress';
    c.inPorts.add(MAIN_INPUT_STRING, {
        datatype: 'array',
        description: 'the list of reactions to format',
        required: true
    });
    c.inPorts.add('anonymize', {
        datatype: 'boolean',
        description: 'whether to remove the information associating votes with people'
    });
    c.outPorts.add('formatted', {
        datatype: 'string'
    });
    c.process(process);
    return c;
github samtecspg / articulate / api / components / action.find-post-format-by-action-id.js View on Github external
exports.getComponent = () => {

    const c = new NoFlo.Component();
    c.description = 'Get Post Format by Action id';
    c.icon = 'user';
    c.inPorts.add(PORT_ACTION, {
        datatype: 'object',
        description: 'Object with all parsed values.'
    });

    c.inPorts.add(PORT_REDIS, {
        datatype: 'object',
        description: 'Redis client'
    });

    c.outPorts.add(PORT_OUT, {
        datatype: 'object'
    });
github rapid-sensemaking-framework / noflo-rsf / components / FormatPairwiseQuantifiedList.js View on Github external
var getComponent = function () {
    var c = new noflo.Component();
    c.description = 'Format a list of pairwise freeform responses to a single string message';
    c.icon = 'compress';
    c.inPorts.add(MAIN_INPUT_STRING, {
        datatype: 'array',
        description: 'the list of reactions to format',
        required: true
    });
    c.inPorts.add('anonymize', {
        datatype: 'boolean',
        description: 'whether to remove the information associating responses with people'
    });
    c.outPorts.add('formatted', {
        datatype: 'string'
    });
    c.process(process);
    return c;
github samtecspg / articulate / api / components / agent.find-actions-by-agent-id.js View on Github external
exports.getComponent = () => {

    const c = new NoFlo.Component();
    c.description = 'Get all actions by agent id';
    c.icon = 'user';

    c.inPorts.add(PORT_IN, {
        datatype: 'object',
        description: 'Object with all parsed values.'
    });

    c.inPorts.add(PORT_DOMAIN, {
        datatype: 'boolean',
        description: 'Actioin Exists'
    });

    c.inPorts.add(PORT_REDIS, {
        datatype: 'object',
        description: 'Redis client'
github noflo / noflo-core / components / Split.js View on Github external
exports.getComponent = () => {
  const c = new noflo.Component();
  c.icon = 'expand';
  c.description = `This component receives data on a single input port and 
sends the same data out to all connected output ports`;

  c.inPorts.add('in', {
    datatype: 'all',
    description: 'Packet to be forwarded',
  });

  c.outPorts.add('out', {
    datatype: 'all',
  });

  return c.process((input, output) => {
    const data = input.get('in');
    output.sendDone({ out: data });
github noflo / noflo-core / components / ReadGlobal.js View on Github external
exports.getComponent = () => {
  const c = new noflo.Component();
  c.description = 'Returns the value of a global variable.';
  c.icon = 'usd';

  c.inPorts.add('name', {
    description: 'The name of the global variable.',
    datatype: 'string',
  });

  c.outPorts.add('value', {
    description: 'The value of the variable.',
  });
  c.outPorts.add('error', {
    description: 'Any errors that occured reading the variables value.',
    datatype: 'object',
  });
github samtecspg / articulate / api / components / saying.find-by-id.js View on Github external
exports.getComponent = () => {

    const c = new NoFlo.Component();
    c.description = 'Get Saying by id';
    c.icon = 'user';
    c.inPorts.add(PORT_IN, {
        datatype: 'object',
        description: 'Object with all parsed values.'
    });

    c.inPorts.add(PORT_REDIS, {
        datatype: 'object',
        description: 'Redis client'
    });

    c.outPorts.add(PORT_OUT, {
        datatype: 'object'
    });
github rapid-sensemaking-framework / noflo-rsf / ts-components / WriteMongoRecord.ts View on Github external
const getComponent = () => {
  const c = new noflo.Component()
  c.description = ''
  c.icon = 'handshake-o'
  c.inPorts.add('mongo_uri', {
    datatype: 'string',
    description: 'The mongodb uri to connect to',
    required: true
  })
  c.inPorts.add('database_name', {
    datatype: 'string',
    description: 'The name of the database',
    required: true
  })
  c.inPorts.add('collection_name', {
    datatype: 'string',
    description: 'The name of the collection',
    required: true

noflo

Flow-Based Programming environment for JavaScript

MIT
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis