How to use digitaljs - 3 common examples

To help you get started, we’ve selected a few digitaljs 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 tilk / digitaljs_online / src / client / index.js View on Github external
function mkcircuit(data) {
    loading = false;
    $('form').find('input, textarea, button, select').prop('disabled', false);
    circuit = new digitaljs.Circuit(data);
    circuit.on('postUpdateGates', (tick) => {
        $('#tick').val(tick);
    });
    circuit.start();
    monitor = new digitaljs.Monitor(circuit);
    if (monitormem) {
        monitor.loadWiresDesc(monitormem);
        monitormem = undefined;
    }
    monitorview = new digitaljs.MonitorView({model: monitor, el: $('#monitor') });
    paper = circuit.displayOn($('<div>').appendTo($('#paper')));
    circuit.on('userChange', () => {
        updatebuttons();
    });
    circuit.on('changeRunning', () => {
        updatebuttons();
github tilk / digitaljs_online / src / client / index.js View on Github external
function mkcircuit(data) {
    loading = false;
    $('form').find('input, textarea, button, select').prop('disabled', false);
    circuit = new digitaljs.Circuit(data);
    circuit.on('postUpdateGates', (tick) => {
        $('#tick').val(tick);
    });
    circuit.start();
    monitor = new digitaljs.Monitor(circuit);
    if (monitormem) {
        monitor.loadWiresDesc(monitormem);
        monitormem = undefined;
    }
    monitorview = new digitaljs.MonitorView({model: monitor, el: $('#monitor') });
    paper = circuit.displayOn($('<div>').appendTo($('#paper')));
    circuit.on('userChange', () => {
        updatebuttons();
    });
    circuit.on('changeRunning', () => {
        updatebuttons();
    });
    updatebuttons();
    $('#monitorbox button').prop('disabled', false);
    $('#monitorbox button[name=ppt_up]').on('click', (e) => { monitorview.pixelsPerTick *= 2; });
    $('#monitorbox button[name=ppt_down]').on('click', (e) => { monitorview.pixelsPerTick /= 2; });
github tilk / digitaljs_online / src / client / index.js View on Github external
function mkcircuit(data) {
    loading = false;
    $('form').find('input, textarea, button, select').prop('disabled', false);
    circuit = new digitaljs.Circuit(data);
    circuit.on('postUpdateGates', (tick) => {
        $('#tick').val(tick);
    });
    circuit.start();
    monitor = new digitaljs.Monitor(circuit);
    if (monitormem) {
        monitor.loadWiresDesc(monitormem);
        monitormem = undefined;
    }
    monitorview = new digitaljs.MonitorView({model: monitor, el: $('#monitor') });
    paper = circuit.displayOn($('<div>').appendTo($('#paper')));
    circuit.on('userChange', () => {
        updatebuttons();
    });
    circuit.on('changeRunning', () => {
        updatebuttons();
    });
    updatebuttons();
    $('#monitorbox button').prop('disabled', false);
    $('#monitorbox button[name=ppt_up]').on('click', (e) => { monitorview.pixelsPerTick *= 2; });
    $('#monitorbox button[name=ppt_down]').on('click', (e) => { monitorview.pixelsPerTick /= 2; });
    $('#monitorbox button[name=left]').on('click', (e) => { 
        monitorview.live = false; monitorview.start -= monitorview.width / monitorview.pixelsPerTick / 4;
    });
    $('#monitorbox button[name=right]').on('click', (e) => { 
        monitorview.live = false; monitorview.start += monitorview.width / monitorview.pixelsPerTick / 4;

digitaljs

Digital logic simulator

BSD-2-Clause
Latest version published 9 months ago

Package Health Score

66 / 100
Full package analysis