<commit_before>var Line2D;
if (require) {
    Line2D = require('./dist/line2d')
} else {
    Line2D = window.Line2D
}

var emptyScene = Line2D.newScene();

// var p1 = new Line2D.Point('0', [0, 0]);
// var p2 = new Line2D.Point('1', [1, 1]);

// var l = new Line2D.Line('0', p1, p2);

var s1 = emptyScene
    .addPoint('0_0', [0, 0])
    .addPoints([
        ['0_1', [0, 1]],
        ['0_2', [1, 0]]
    ])
    .addLine('0_0', ['0_0', '0_1'])
    .addLines([
        ['0_1', ['0_1', '0_2']],
        ['0_2', ['0_2', '0_0']]
    ])

console.log(JSON.stringify(s1));
console.log(s1.toJS());
<commit_msg>Alter structure of input points/lines<commit_after>var Line2D;
if (require) {
    Line2D = require('./dist/line2d')
} else {
    Line2D = window.Line2D
}
var P = Line2D.toPoints;
var L = Line2D.toLines;

var emptyScene = Line2D.newScene();

var s1 = emptyScene
    .addPoint('0_0', [0, 0])
    .addPoints(P([
        ['0_1', [0, 1]],
        ['0_2', [1, 0]]
    ]))
    .addLine('0_0', ['0_0', '0_1'])
    .addLines(L([
        ['0_1', ['0_1', '0_2']],
        ['0_2', ['0_2', '0_0']]
    ]))

console.log(JSON.stringify(s1));
console.log(s1.toJS());

{'fraction_non_alphanumeric': 0.23958333333333334, 'fraction_numerical': 0.08159722222222222, 'mean_word_length': 2.780327868852459, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '2662530', 'n_tokens_mistral': 524, 'n_tokens_neox': 513, 'n_words': 102}