How to use basis - 10 common examples

To help you get started, we’ve selected a few basis 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 basisjs / basisjs-tools / test / extract / env / basis1.4 / app / src / app.js View on Github external
// resolve by ns
require('ns');
basis.require('ns.basisrequire');
require('ns.require');

basis.require('ns:ns-basisrequire.js');
require('ns:ns-require.js');

basis.resource('ns:basisresource.js');
resource('ns:resource.js');

basis.asset('ns:basis-asset.json');
asset('ns:asset.json');

l10n.dictionary('ns:dictionary.l10n');

// unknown ns
require('unknownns');
basis.require('unknownns.basisrequire');
require('unknownns.require');

basis.require('unknownns:ns-basisrequire.js');
require('unknownns:ns-require.js');

basis.resource('unknownns:basisresource.js');
resource('unknownns:resource.js');

basis.asset('unknownns:basis-asset.json');
asset('unknownns:asset.json');

l10n.dictionary('unknownns:dictionary.l10n');
github basisjs / basisjs-tools / test / extract / env / basis1.3 / app / src / app.js View on Github external
var l10n = require('basis.l10n');
var template = require('basis.template');

basis.require('app.basisrequire');
require('app.require');

basis.require('./root/require.js');
basis.resource('./root/resource.js');
basis.asset('./root/asset.js');

require('./require.js');
resource('./resource.js');
l10n.dictionary('./root/explicit.l10n');
l10n.dictionary('./root/implicit.js');
l10n.dictionary(__dirname + '/explicit.l10n');
l10n.dictionary(__dirname + '/implicit.js');
l10n.dictionary(__filename);

// resolve by ns
require('ns');
basis.require('ns.basisrequire');
require('ns.require');

// unknown ns
require('unknownns');
basis.require('unknownns.basisrequire');
require('unknownns.require');

// templates
resource('./template/rel.tmpl');
github basisjs / basisjs-tools / test / extract / env / basis1.4 / app / src / app.js View on Github external
var l10n = require('basis.l10n');
var template = require('basis.template');

basis.require('app.basisrequire');
require('app.require');

basis.require('./root/require.js');
basis.resource('./root/resource.js');
basis.asset('./root/asset.js');

require('./require.js');
resource('./resource.js');
asset('./asset.js');
l10n.dictionary('./root/explicit.l10n');
l10n.dictionary('./root/implicit.js');
l10n.dictionary(__dirname + '/explicit.l10n');
l10n.dictionary(__dirname + '/implicit.js');
var dict = l10n.dictionary(__filename);
dict.token('test');

// resolve by ns
require('ns');
basis.require('ns.basisrequire');
require('ns.require');

basis.require('ns:ns-basisrequire.js');
require('ns:ns-require.js');

basis.resource('ns:basisresource.js');
resource('ns:resource.js');
github basisjs / basisjs-tools / test / extract / env / basis1.4 / app / src / app.js View on Github external
basis.require('app.basisrequire');
require('app.require');

basis.require('./root/require.js');
basis.resource('./root/resource.js');
basis.asset('./root/asset.js');

require('./require.js');
resource('./resource.js');
asset('./asset.js');
l10n.dictionary('./root/explicit.l10n');
l10n.dictionary('./root/implicit.js');
l10n.dictionary(__dirname + '/explicit.l10n');
l10n.dictionary(__dirname + '/implicit.js');
var dict = l10n.dictionary(__filename);
dict.token('test');

// resolve by ns
require('ns');
basis.require('ns.basisrequire');
require('ns.require');

basis.require('ns:ns-basisrequire.js');
require('ns:ns-require.js');

basis.resource('ns:basisresource.js');
resource('ns:resource.js');

basis.asset('ns:basis-asset.json');
asset('ns:asset.json');
github basisjs / basisjs-tools / test / extract / env / basis1.3 / app / src / app.js View on Github external
var l10n = require('basis.l10n');
var template = require('basis.template');

basis.require('app.basisrequire');
require('app.require');

basis.require('./root/require.js');
basis.resource('./root/resource.js');
basis.asset('./root/asset.js');

require('./require.js');
resource('./resource.js');
l10n.dictionary('./root/explicit.l10n');
l10n.dictionary('./root/implicit.js');
l10n.dictionary(__dirname + '/explicit.l10n');
l10n.dictionary(__dirname + '/implicit.js');
l10n.dictionary(__filename);

// resolve by ns
require('ns');
basis.require('ns.basisrequire');
require('ns.require');

// unknown ns
require('unknownns');
basis.require('unknownns.basisrequire');
require('unknownns.require');

// templates
resource('./template/rel.tmpl');
github basisjs / basisjs-tools / test / extract / env / basis1.4 / app / src / app.js View on Github external
var l10n = require('basis.l10n');
var template = require('basis.template');

basis.require('app.basisrequire');
require('app.require');

basis.require('./root/require.js');
basis.resource('./root/resource.js');
basis.asset('./root/asset.js');

require('./require.js');
resource('./resource.js');
asset('./asset.js');
l10n.dictionary('./root/explicit.l10n');
l10n.dictionary('./root/implicit.js');
l10n.dictionary(__dirname + '/explicit.l10n');
l10n.dictionary(__dirname + '/implicit.js');
var dict = l10n.dictionary(__filename);
dict.token('test');

// resolve by ns
require('ns');
basis.require('ns.basisrequire');
require('ns.require');

basis.require('ns:ns-basisrequire.js');
require('ns:ns-require.js');

basis.resource('ns:basisresource.js');
resource('ns:resource.js');
github basisjs / basisjs / src / basis / ui / scroller.js View on Github external
var deltaTime = timeNow - this.lastMotionUpdateTime;
      deltaTime = Math.max(10, deltaTime); // low-timer granularity compensation
      this.lastMotionUpdateTime = 0;

      if (this.scrollX)
      {
        // 100msec is a full hold gesture that complete zeroes out the velocity to be used as inertia
        this.currentVelocityX *= 1 - Math.min(1, Math.max(0, deltaTime / 100));
      }

      if (this.scrollY)
        this.currentVelocityY *= 1 - Math.min(1, Math.max(0, deltaTime / 100));

      Event.removeGlobalHandler('mousemove', this.onMouseMove, this);
      Event.removeGlobalHandler('touchmove', this.onMouseMove, this);
      Event.removeGlobalHandler('mouseup', this.onMouseUp, this);
      Event.removeGlobalHandler('touchend', this.onMouseUp, this);

      if (this.minScrollDeltaXReached || this.minScrollDeltaYReached)
        Event.captureEvent('click', basis.fn.$true);

      this.emit_startInertia();
    },
github basisjs / basisjs / src / basis / ui / slider.js View on Github external
wheelStep: function(event){
        if (event.wheelDelta < 0)
          this.stepDown();
        else
          this.stepUp();

        // prevent page scrolling
        event.preventDefault();
      }
    },

   /**
    * @inheritDoc
    */
    satellite: {
      marks: Node.subclass({
        className: namespace + '.MarkLayers',
        template: templates.MarkLayers,
        childClass: MarkLayer
      })
    },

   /**
    * @inheritDoc
    */
    init: function(){
      // save init values
      var step = this.step;
      var value = this.value;

      // make new values possible
      this.step = NaN;
github basisjs / basisjs / src / devpanel / api / index.js View on Github external
var Value = require('basis.data').Value;
var session = new Value();
var connected = new Value({ value: false });
var features = new Value({ value: [] });
var inspect = new Value({
  proxy: function(value){
    return value || false;
  }
});
var api = {};

// init default APIs
define('file', require('./file.js'));
define('app', require('./app.js'));
define('inspect', require('./inspect.js'));

function createOutputChannel(ns, channel, send){
  function sendData(){
    send({
      type: ns,
      payload: channel.value
github smelukov / webpack-runtime-analyzer / src / ui / src / ui / graph / index.js View on Github external
},
    endRender: function() {
        // stub
    }
});

var graph = Viva.Graph.graph();
var renderer = Viva.Graph.View.renderer(graph, {
    container: svgGraphics.element,
    graphics: svgGraphics,
    prerender: 50
});

renderer.run();

var isPaused = new Value({ value: true });

var SpeedSlider = Slider.subclass({
    template: resource('./template/slider.tmpl'),
    max: 100,
    step: 10,
    value: 30
});

var LinksCounter = Node.subclass({
    template: resource('./template/counters.tmpl'),
    binding: {
        totalLinks: Value.query('owner.totalLinks.value'),
        renderedLinks: Value.query('owner.renderedLinks.value'),
        totalNodes: Value.query('owner.totalNodes.value'),
        renderedNodes: Value.query('owner.renderedNodes.value')
    }