<commit_before>// Welcome to Automaton playground!
// Use the dropdown above to see other examples and tutorials...

const PI = Math.PI;
const TAU = PI * 2.0;

const width = canvas.width = 320;
const height = canvas.height = 320;

const context = canvas.getContext( '2d' );

// == initialize an automaton instance =============================================================
const automaton = new AUTOMATON_WITH_GUI.AutomatonWithGUI(
  JSON.parse( `
{"version":"3.0.0-beta5","resolution":100,"curves":[{"nodes":[{"out":{"time":0.06345177664974619,"value":0}},{"time":0.2238578680203046,"value":0.8088235294117649,"in":{"time":-0.08883248730964469,"value":-0.08921568627450979},"out":{"time":0.08883248730964469,"value":0.08921568627450979}},{"time":1,"value":1,"in":{"time":-0.47969543147208127,"value":0}}]},{"nodes":[{"out":{"time":0.10913705583756345,"value":0}},{"time":0.6000000000000001,"value":1,"in":{"time":-0.5507614213197969,"value":0}}]},{"nodes":[{},{"time":0.1,"value":1},{"time":0.5,"value":1},{"time":0.6000000000000001},{"time":1.8}],"fxs":[{"def":"cds","params":{"factor":300,"ratio":1,"preserve":false},"length":0.5},{"def":"gravity","params":{"a":30,"e":0.5,"preserve":true},"time":0.5,"length":0.728136781314195}]},{"nodes":[{"value":1,"out":{"time":0.05,"value":0}},{"time":0.05,"in":{"time":-0.05,"value":0}}]},{"nodes":[{},{"time":1,"value":1}]},{"nodes":[{"out":{"time":0.2817258883248731,"value":0}},{"time":0.4,"value":1,"in":{"time":-0.11421319796954314,"value":-0.5970588235294118}}]},{"nodes":[{},{"time":4,"value":1}]},{"nodes":[{},{"time":0.1,"value":1},{"time":2,"value":1}],"fxs":[{"def":"cds","params":{"factor":100,"ratio":1,"preserve":false},"length":2}]}],"channels":{"rect/x":{"items":[{"value":0.5}]},"rect/y":{"items":[{"value":0.5},{"time":0.4,"length":1.3000000000000003,"value":0.5,"curve":2,"amp":-0.3},{"time":3.6,"length":0.40000000000000036,"value":0.5,"curve":5}]},"rect/rotate":{"items":[{"time":0.2,"length":0.6,"curve":1},{"time":3.6,"length":0.40000000000000036,"curve":5,"amp":0.1}]},"rect/sizeX":{"items":[{"time":0.2,"length":0.6,"curve":1,"amp":0.29999999999999993},{"time":1.9000000000000001,"length":0.15,"value":0.3,"curve":1,"speed":4,"amp":0.6000000000000001}]},"rect/sizeY":{"items":[{"time":0.2,"length":0.6,"curve":1,"amp":0.29999999999999993}]},"rect/bounce":{"items":[{"time":0.9,"length":0.8000000000000002,"value":1,"reset":true}]},"ring/radius0":{"items":[{"length":1,"curve":0}]},"ring/radius1":{"items":[{"time":0.045685279187817264,"length":1,"curve":0,"amp":0.9}]},"ring/radius2":{"items":[{"time":0.10152284263959391,"length":1,"curve":0,"amp":0.9}]},"ring/radius3":{"items":[{"time":0.15228426395939088,"length":1,"curve":0,"amp":0.9}]},"ring/radius4":{"items":[{"time":0.1979695431472081,"length":1,"curve":0,"amp":1.1}]},"dots/radius0":{"items":[{"time":1.5,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"dots/radius1":{"items":[{"time":1.525,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"dots/radius2":{"items":[{"time":1.575,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"dots/radius3":{"items":[{"time":1.55,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"rect/fill":{"items":[{"value":1},{"time":1.7000000000000002,"length":0.05,"curve":3},{"time":1.7500000000000002,"length":0.05,"curve":3},{"time":1.8000000000000003,"length":0.05,"curve":3}]},"text/name":{"items":[{"time":2.1,"length":0.30000000000000027,"curve":4,"speed":3.33333333333334}]},"text/description":{"items":[{"time":2.5,"length":0.8,"curve":4,"speed":1.25}]},"zigzag/scroll":{"items":[{"time":0.5,"length":3.5,"value":0.5,"curve":6}]},"zigzag/pos":{"items":[{"time":1.8,"length":1.2000000000000002,"curve":7,"amp":1.4},{"time":3.5,"length":0.40000000000000036,"value":1.4000000000000001,"curve":5,"amp":-1.4000000000000001}]}},"labels":{},"guiSettings":{"snapTimeActive":true,"snapTimeInterval":0.1,"snapValueActive":true,"snapValueInterval":0.1,"snapBeatActive":false,"snapBeatBPM":120,"minimizedPrecisionTime":3,"minimizedPrecisionValue":3}}
  ` ), // put your automaton savedata here
  {
    gui: divAutomatonContainer, // where you want to put entire automaton GUI
    isPlaying: true, // it's playing by default
    installBuiltinFxs: true, // install bunch of fxs by default
  }
);
const auto = automaton.auto; // mighty auto function!
<commit_msg>(from automaton-with-gui repo) demo.js: add labels<commit_after>// Welcome to Automaton playground!
// Use the dropdown above to see other examples and tutorials...

const PI = Math.PI;
const TAU = PI * 2.0;

const width = canvas.width = 320;
const height = canvas.height = 320;

const context = canvas.getContext( '2d' );

// == initialize an automaton instance =============================================================
const automaton = new AUTOMATON_WITH_GUI.AutomatonWithGUI(
  JSON.parse( `
{"version":"3.0.0-beta5","resolution":100,"curves":[{"nodes":[{"out":{"time":0.06345177664974619,"value":0}},{"time":0.2238578680203046,"value":0.8088235294117649,"in":{"time":-0.08883248730964469,"value":-0.08921568627450979},"out":{"time":0.08883248730964469,"value":0.08921568627450979}},{"time":1,"value":1,"in":{"time":-0.47969543147208127,"value":0}}]},{"nodes":[{"out":{"time":0.10913705583756345,"value":0}},{"time":0.6000000000000001,"value":1,"in":{"time":-0.5507614213197969,"value":0}}]},{"nodes":[{},{"time":0.1,"value":1},{"time":0.5,"value":1},{"time":0.6000000000000001},{"time":1.8}],"fxs":[{"def":"cds","params":{"factor":300,"ratio":1,"preserve":false},"length":0.5},{"def":"gravity","params":{"a":30,"e":0.5,"preserve":true},"time":0.5,"length":0.728136781314195}]},{"nodes":[{"value":1,"out":{"time":0.05,"value":0}},{"time":0.05,"in":{"time":-0.05,"value":0}}]},{"nodes":[{},{"time":1,"value":1}]},{"nodes":[{"out":{"time":0.2817258883248731,"value":0}},{"time":0.4,"value":1,"in":{"time":-0.11421319796954314,"value":-0.5970588235294118}}]},{"nodes":[{},{"time":4,"value":1}]},{"nodes":[{},{"time":0.1,"value":1},{"time":2,"value":1}],"fxs":[{"def":"cds","params":{"factor":100,"ratio":1,"preserve":false},"length":2}]}],"channels":{"rect/x":{"items":[{"value":0.5}]},"rect/y":{"items":[{"value":0.5},{"time":0.4,"length":1.3000000000000003,"value":0.5,"curve":2,"amp":-0.3},{"time":3.6,"length":0.40000000000000036,"value":0.5,"curve":5}]},"rect/rotate":{"items":[{"time":0.2,"length":0.6,"curve":1},{"time":3.6,"length":0.40000000000000036,"curve":5,"amp":0.1}]},"rect/sizeX":{"items":[{"time":0.2,"length":0.6,"curve":1,"amp":0.29999999999999993},{"time":1.9000000000000001,"length":0.15,"value":0.3,"curve":1,"speed":4,"amp":0.6000000000000001}]},"rect/sizeY":{"items":[{"time":0.2,"length":0.6,"curve":1,"amp":0.29999999999999993}]},"rect/bounce":{"items":[{"time":0.9,"length":0.8000000000000002,"value":1,"reset":true}]},"ring/radius0":{"items":[{"length":1,"curve":0}]},"ring/radius1":{"items":[{"time":0.045685279187817264,"length":1,"curve":0,"amp":0.9}]},"ring/radius2":{"items":[{"time":0.10152284263959391,"length":1,"curve":0,"amp":0.9}]},"ring/radius3":{"items":[{"time":0.15228426395939088,"length":1,"curve":0,"amp":0.9}]},"ring/radius4":{"items":[{"time":0.1979695431472081,"length":1,"curve":0,"amp":1.1}]},"dots/radius0":{"items":[{"time":1.5,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"dots/radius1":{"items":[{"time":1.525,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"dots/radius2":{"items":[{"time":1.575,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"dots/radius3":{"items":[{"time":1.55,"length":0.15,"curve":1,"speed":4,"amp":0.05}]},"rect/fill":{"items":[{"value":1},{"time":1.7000000000000002,"length":0.05,"curve":3},{"time":1.7500000000000002,"length":0.05,"curve":3},{"time":1.8000000000000003,"length":0.05,"curve":3}]},"text/name":{"items":[{"time":2.1,"length":0.30000000000000027,"curve":4,"speed":3.33333333333334}]},"text/description":{"items":[{"time":2.5,"length":0.8,"curve":4,"speed":1.25}]},"zigzag/scroll":{"items":[{"time":0.5,"length":3.5,"value":0.5,"curve":6}]},"zigzag/pos":{"items":[{"time":1.8,"length":1.2000000000000002,"curve":7,"amp":1.4},{"time":3.5,"length":0.40000000000000036,"value":1.4000000000000001,"curve":5,"amp":-1.4000000000000001}]}},"labels":{"blink":1.7000000000000002,"wave":0,"text":2.1,"fall":3.6,"bounce":0.9},"guiSettings":{"snapTimeActive":true,"snapTimeInterval":0.1,"snapValueActive":true,"snapValueInterval":0.1,"snapBeatActive":false,"snapBeatBPM":120,"minimizedPrecisionTime":3,"minimizedPrecisionValue":3}}
  ` ), // put your automaton savedata here
  {
    gui: divAutomatonContainer, // where you want to put entire automaton GUI
    isPlaying: true, // it's playing by default
    installBuiltinFxs: true, // install bunch of fxs by default
  }
);
const auto = automaton.auto; // mighty auto function!

{'fraction_non_alphanumeric': 0.3308141532119547, 'fraction_numerical': 0.20496965533035613, 'mean_word_length': 13.981132075471699, 'pattern_counts': {'":': 489, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 39, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1851444', 'n_tokens_mistral': 4412, 'n_tokens_neox': 3290, 'n_words': 163}