When I try to set the muted_color or muted_alpha attributes for a line plot using code like:
f.line({ field: “x” }, { field: “y” }, {
source: source,
line_color: ‘#2185d0’,
line_alpha: 1.0,
muted_alpha: 0.15
})
I get a JavaScript error:
Failed to load all required resources Error: property Line.muted_alpha wasn’t declared
at Line.exports.HasProps.HasProps.setv (has_props.js:264)
at Line.HasProps (has_props.js:171)
at Line.Model [as constructor] (model.js:24)
at Line.Glyph [as constructor] (glyph.js:366)
at Line.XYGlyph [as constructor] (xy_glyph.js:47)
at new Line (line.js:184)
at plotting.js:529
at r.t.Figure.r._glyph (plotting.js:532)
at r.t.Figure.r.line (plotting.js:282)
I am able to pass muted_* to the line function in the python version of Bokeh, but I can’t see how to set those values in the JS version.
This is exactly correct. The muted_X, selection_X, and nonselection_X keyword arguments to Figure are conveniences currently only on the Python side. It's possible he JS API could be updated to include them as well (might make a good task for a new contributor). But currently they don't, so you will need to make and set the muted_glyph property of the glyph renderer by hand, as suggested.
Thanks,
Bryan
···
On Nov 24, 2017, at 08:18, Eugene Pakhomov <[email protected]> wrote:
Hi,
I think it's a discrepancy between Python and JS Bokeh interface - there are no mentions of muted glyphs in the JS Figure code.
Could you please create a GitHub issue with a small reproducible example?
As a workaround, you can store the result of a working "f.line" invocation - that would be an instance of GlyphRenderer.
Then, you'd have to manually create a correct glyph and assign it to the "muted_glyph" property of that renderer.
Regards,
Eugene
On Friday, November 24, 2017 at 8:52:25 PM UTC+7, Nathan Apple wrote:
Hello,
When I try to set the muted_color or muted_alpha attributes for a line plot using code like:
f.line({ field: "x" }, { field: "y" }, {
source: source,
line_color: '#2185d0',
line_alpha: 1.0,
muted_alpha: 0.15
})
I get a JavaScript error:
Failed to load all required resources Error: property Line.muted_alpha wasn't declared
at Line.exports.HasProps.HasProps.setv (has_props.js:264)
at Line.HasProps (has_props.js:171)
at Line.Model [as constructor] (model.js:24)
at Line.Glyph [as constructor] (glyph.js:366)
at Line.XYGlyph [as constructor] (xy_glyph.js:47)
at new Line (line.js:184)
at plotting.js:529
at r.t.Figure.r._glyph (plotting.js:532)
at r.t.Figure.r.line (plotting.js:282)
I am able to pass muted_* to the line function in the python version of Bokeh, but I can't see how to set those values in the JS version.