[bokeh] customJS question

The GapMinder example is a bit unusual, and the technique of templating in all the data in the code is probably not always needed. Can you describe what exactly you are trying to accomplish with the slider in a bit more detail?



On May 26, 2016, at 10:15 AM, [email protected] wrote:

I'm trying to create an interactive slider plot and leaning heavily on the gapminder example for reference.
My issue is with passing two plot render sources through CustomJS... just stuck on it, since unfamiliar with JS.

I have this working (expected, since it is copy/paste from gapminder):

    # Add the slider
    code = """
        var M = slider.get('value'),
            presentM_source = %s,
            new_source_data = presentM_source[M].get('data')];
        rend1_source.set('data', new_source_data);
        text_source.set('data', {'M': [String(M)]});
    """ % js_source_array
    callback = CustomJS(args=presentM_source, code=code)
    slider = Slider(start=listM[0], end=listM[-1], value=1, step=1, title="M-Value", callback=callback, name='testy')
    callback.args["rend1_source"] = rend1_source
    callback.args["slider"] = slider
    callback.args["text_source"] = text_source

I have a rend2_source / pastM_source that needs to be plotted with same slider also, but I can't figure out how to
push it through. Is this possible or do I need to refactor instead of just throwing rocks at a wall


You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/170d3231-d654-43b0-b60c-0a08075798a0%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.