CustomJS to add more circles

How can I write a CustomJS function to add more circles to a circle glyph? I tried (and similarly for y), but this didn’t work.

@aroberts If you update the CDS the way you show, then you need to apply an .change.emit() to the CDS. However, I believe it is not recommended to update a CDS this way (with change.emit()). Either one updates the whole .data at once or, as in your case, the recommended way of appending data to a CDS is the use of stream.

    args = {'source': source},
    code = '''
    const data = {
        'x' : [Math.random() * 10],
        'y' : [Math.random() * 10],

    // or - not recommended
    // * 10);
    // * 10);
1 Like