how many ticks will be for the graph in FuncTickFormatter?

hi,

Using FuncTickFormatter function, I constructed ticks. But I need to know how many ticks will be for the graph in FuncTickFormatter function as javascript variable

FuncTickFormatter ( code="""

//?? count of ticks

“”" % xlabel_dict)

how can I do that ?

regards

Hi Ahmet,

FuncTickFormatter doesn’t provide any way for your code to know anything about the collection of ticks, only about a single tick at a time.

In order to circumvent this, you have to write your own tick formatter that inherits FuncTickFormatter and overrides “doFormat” method. For more details look here https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html and here https://github.com/bokeh/bokeh/blob/0.12.13/bokehjs/src/coffee/models/formatters/func_tick_formatter.coffee#L16

Regards,

Eugene

···

On Monday, February 5, 2018 at 6:25:51 PM UTC+7, Ahmet Temiz wrote:

hi,

Using FuncTickFormatter function, I constructed ticks. But I need to know how many ticks will be for the graph in FuncTickFormatter function as javascript variable

FuncTickFormatter ( code="""

//?? count of ticks

“”" % xlabel_dict)

how can I do that ?

regards

Hi Ahmet,

FuncTickFormatter doesn't provide any way for your code to know anything about the collection of ticks, only about a single tick at a time.
In order to circumvent this, you have to write your own tick formatter that inherits FuncTickFormatter and overrides "doFormat" method. For more details look here https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html and here https://github.com/bokeh/bokeh/blob/0.12.13/bokehjs/src/coffee/models/formatters/func_tick_formatter.coffee#L16

Regards,
Eugene

hi,

Using FuncTickFormatter function, I constructed ticks. But I need to know how many ticks will be for the graph in FuncTickFormatter function as javascript variable

FuncTickFormatter ( code="""
   ..
   ..
   //?? count of ticks
""" % xlabel_dict)

how can I do that ?

regards

--
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/77aeac9f-1adb-4337-90d4-314b418ea667%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

···

On Feb 5, 2018, at 05:34, Eugene Pakhomov <[email protected]> wrote:
On Monday, February 5, 2018 at 6:25:51 PM UTC+7, Ahmet Temiz wrote:

It's also possible to inherit from the top level base, TickFormmatter

Thanks,

Bryan

···

On Feb 5, 2018, at 05:34, Eugene Pakhomov <[email protected]> wrote:

Hi Ahmet,

FuncTickFormatter doesn't provide any way for your code to know anything about the collection of ticks, only about a single tick at a time.
In order to circumvent this, you have to write your own tick formatter that inherits FuncTickFormatter and overrides "doFormat" method. For more details look here https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html and here https://github.com/bokeh/bokeh/blob/0.12.13/bokehjs/src/coffee/models/formatters/func_tick_formatter.coffee#L16

Regards,
Eugene

On Monday, February 5, 2018 at 6:25:51 PM UTC+7, Ahmet Temiz wrote:
hi,

Using FuncTickFormatter function, I constructed ticks. But I need to know how many ticks will be for the graph in FuncTickFormatter function as javascript variable

FuncTickFormatter ( code="""
   ..
   ..
   //?? count of ticks
""" % xlabel_dict)

how can I do that ?

regards

--
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/77aeac9f-1adb-4337-90d4-314b418ea667%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I need to know how many ticks will be for the graph in FuncTickFormatter function

In Bokeh 0.12.15+, you will be able to use ticks variable (an array of all ticks), i.e. ticks.length. You can start experimenting with it now.