How to use the vega.transforms 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 / transforms / index.js View on Github external
const ns = require('../util/ns');
const MANIPULATORS = ns('manipulators_');

const t = {
  [`${MANIPULATORS}area`]: AreaManipulators,
  [`${MANIPULATORS}group`]: RectManipulators,
  [`${MANIPULATORS}line`]: LineManipulators,
  [`${MANIPULATORS}rect`]: RectManipulators,
  [`${MANIPULATORS}symbol`]: SymbolManipulators,
  [`${MANIPULATORS}text`]: TextManipulators,
};

// t[ns('bubble_cursor')] = require('./BubbleCursor');

Object.keys(t).forEach(k => (t[k].Definition.type = k));
vega.extend(vega.transforms, t);

export default t;
github vega / lyra / src / js / model / rules / index.js View on Github external
'use strict';
var dl = require('datalib'),
    vg = require('vega'),
    vl = require('vega-lite'),
    // Scale = require('../primitives/Scale'),
    model = require('../'),
    lookup = model.lookup,
    getParent = require('../../util/hierarchy').getParent,
    AGG_OPS = vg.transforms.aggregate.VALID_OPS;

// Pull in the modules which will be assembled into the rules namespace
var VLSingle = require('./VLSingle'),
    data = require('./data'),
    scales = require('./scales'),
    marks = require('./marks'),
    guides = require('./guides'),
    CELLW = 500,
    CELLH = 200;

/**
 * There isn't a 1-1 correspondance between Lyra and Vega-Lite channels.
 * This function returns the most suitable Vega-Lite channel for a Lyra one.
 *
 * @memberOf rules
 * @param  {string} name The name of a Lyra channel