☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Creating a custom TickFormatter, getting "model not registered before first usage"

Community Support
lbrito
lbrito

Hi,

As suggested by Bryan in a GH topic (desired_num_ticks not working when using custom x_range · Issue #3193 · bokeh/bokeh · GitHub), I’m trying to build a custom TickFormatter. My goal is to plot financial times series with “broken” x axis (that is, the series has gaps on weekends and holidays which I wish not to be plotted, which is currently impossible with the Datetime plot).

I cloned & compiled the dev repo just fine. However, I’m having some issues defining a new TickFormatter. I just copied and pasted the PrintfTickFormatter class and the corresponding coffeescript file and renamed the copied code as “DateGapTickFormatter”. This is the JS console output when I try instantiating the new TickFormatter:

Module `DateGapTickFormatter’ does not exists. The problem may be two fold. Either a model was requested that’s available in an extra bundle, e.g. a widget, or a custom model was requested, but it wasn’t registered before first usage.

Is there anything else I need to do besides defining the TickFormatter class and the coffeescript?

⌁   Link to post
Mateusz_Paprocki
Mateusz_Paprocki

Hi,

···

On Sun, Nov 29, 2015 at 4:14 PM, lbrito@gmail.com wrote:

Hi,

As suggested by Bryan in a GH topic (https://github.com/bokeh/bokeh/issues/3193), I’m trying to build a custom TickFormatter. My goal is to plot financial times series with “broken” x axis (that is, the series has gaps on weekends and holidays which I wish not to be plotted, which is currently impossible with the Datetime plot).

I cloned & compiled the dev repo just fine. However, I’m having some issues defining a new TickFormatter. I just copied and pasted the PrintfTickFormatter class and the corresponding coffeescript file and renamed the copied code as “DateGapTickFormatter”. This is the JS console output when I try instantiating the new TickFormatter:

Module `DateGapTickFormatter’ does not exists. The problem may be two fold. Either a model was requested that’s available in an extra bundle, e.g. a widget, or a custom model was requested, but it wasn’t registered before first usage.

Is there anything else I need to do besides defining the TickFormatter class and the coffeescript?

yes, you have to add appropriate entry to bokehjs/src/coffee/common/base.coffee (you should easily see the pattern there). However, I recommend to follow the other Brian’s advice and try to use our new custom models machinery (as described in the issue).

Mateusz

–

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 bokeh+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/19584812-2de1-4483-a073-cb6e36fbd1a2%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post

End of archived discussion · Replies are disabled