Skip to content

Help using the Figure object in a custom Bokeh extension #12220

Discussion options

You must be logged in to vote

The solution is to build a plot using the different components found in BokehJS that you can use to create a figure. These include items like axes, grids, glyphs, etc. This means that you cannot use the Figure object directly found in the api module, but you can build a Plot using all the components found in the Figure object. See the example below. This is what I had to do in order to get a figure to render in a custom extension, after creating and adding a glyph.

import {LinearAxis} from '@bokehjs/models/axes/linear_axis';
import {Line} from '@bokehjs/models/glyphs/line';
import {Grid} from '@bokehjs/models/grids/grid';
import {Plot} from '@bokehjs/models/plots/plot';
import {DataRange1d} 

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ndmlny-qs
Comment options

ndmlny-qs Jul 7, 2022
Collaborator Author

Comment options

You must be logged in to vote
1 reply
@ndmlny-qs
Comment options

ndmlny-qs Jul 7, 2022
Collaborator Author

Comment options

You must be logged in to vote
0 replies
Comment options

ndmlny-qs
Aug 9, 2022
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by ndmlny-qs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants