How to use the vega.isArray function in vega

To help you get started, we’ve selected a few vega 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 vega / lyra / src / js / ctrl / export.ts View on Github external
.reduce((children, child) => {
        // If internal === true, children are an array of arrays which must be flattened.
        if (isArray(child)) {
          children.push.apply(children, child);
        } else if (child) {
          children.push(child);
        }
        return children;
      }, []);
  });
github vega / lyra / src / js / actions / bindChannel / parseScales.ts View on Github external
function parse(def: RangeScale) {
  const range = def.range;

  if (def.name === 'x' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'width'))) {
    def.range = 'width';
  } else if (def.name === 'y' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'height'))) {
    def.range = 'height';
  }

  return def;
}
github vega / lyra / src / js / actions / bindChannel / parseScales.ts View on Github external
function parse(def: RangeScale) {
  const range = def.range;

  if (def.name === 'x' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'width'))) {
    def.range = 'width';
  } else if (def.name === 'y' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'height'))) {
    def.range = 'height';
  }

  return def;
}