TextInput convert to interger (float)

Hi, is it possible to convert TextInput values to interger (float) and later use it for drawing charts without using custumjs? I need that as in sliders.py, you could with textinput pass values for amplitude, offset, phase or freq.

Certainly, but this is really a JavaScript question, not a Bokeh one. That said, I imagine this is what you want:

  JavaScript parseInt() Method

Thanks,

Bryan

···

On Jul 24, 2016, at 2:28 AM, [email protected] wrote:

Hi, is it possible to convert TextInput values to interger (float) and later use it for drawing charts without using custumjs? I need that as in sliders.py, you could with textinput pass values for amplitude, offset, phase or freq.

--
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/35983972-ec12-4609-812c-682f70af297a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

“Certainly**” - how? ****In sliders.py expample it don't show how from textinput you could get number(int, float) and then use to make graphs. **``Do i have to write a def for coverting textinput (string) to int(float)?

···

On Monday, July 25, 2016 at 6:08:01 PM UTC+3, Bryan Van de ven wrote:

Certainly, but this is really a JavaScript question, not a Bokeh one. That said, I imagine this is what you want:

    [http://www.w3schools.com/jsref/jsref_parseint.asp](http://www.w3schools.com/jsref/jsref_parseint.asp)

Thanks,

Bryan

On Jul 24, 2016, at 2:28 AM, [email protected] wrote:

Hi, is it possible to convert TextInput values to interger (float) and later use it for drawing charts without using custumjs? I need that as in sliders.py, you could with textinput pass values for amplitude, offset, phase or freq.


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/35983972-ec12-4609-812c-682f70af297a%40continuum.io.

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

I missed the "without" in your OP. To convert the value of a text input to a number you can:

* Write a bokeh server app, and use standard python int(), float() functions
* Use a CustomJS callback, that uses the JS function I linked below
* Write a custom Bokeh extension (http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html\)

There are many ways to do this conversion, which is why there is nothing "built-in" to perform such a conversion.

Bryan

···

On Aug 4, 2016, at 2:39 AM, Andrejus Antoninovas <[email protected]> wrote:

"Certainly" - how? In sliders.py expample it don't show how from textinput you could get number(int, float) and then use to make graphs. Do i have to write a def for coverting textinput (string) to int(float)?

On Monday, July 25, 2016 at 6:08:01 PM UTC+3, Bryan Van de ven wrote:
Certainly, but this is really a JavaScript question, not a Bokeh one. That said, I imagine this is what you want:

        JavaScript parseInt() Method

Thanks,

Bryan

> On Jul 24, 2016, at 2:28 AM, andrejusa...@gmail.com wrote:
>
> Hi, is it possible to convert TextInput values to interger (float) and later use it for drawing charts without using custumjs? I need that as in sliders.py, you could with textinput pass values for amplitude, offset, phase or freq.
>
> --
> 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+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/35983972-ec12-4609-812c-682f70af297a%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/5db51452-8452-4ff0-bac8-66360d961a32%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Any simple example? I am just starting coding in python so it’s hard for me to combine python and bokeh coding.

···

On Thu, Aug 4, 2016 at 2:34 PM, Bryan Van de Ven [email protected] wrote:

I missed the “without” in your OP. To convert the value of a text input to a number you can:

There are many ways to do this conversion, which is why there is nothing “built-in” to perform such a conversion.

Bryan

On Aug 4, 2016, at 2:39 AM, Andrejus Antoninovas [email protected] wrote:

“Certainly” - how? In sliders.py expample it don’t show how from textinput you could get number(int, float) and then use to make graphs. Do i have to write a def for coverting textinput (string) to int(float)?

On Monday, July 25, 2016 at 6:08:01 PM UTC+3, Bryan Van de ven wrote:

Certainly, but this is really a JavaScript question, not a Bokeh one. That said, I imagine this is what you want:

    [http://www.w3schools.com/jsref/jsref_parseint.asp](http://www.w3schools.com/jsref/jsref_parseint.asp)

Thanks,

Bryan

On Jul 24, 2016, at 2:28 AM, [email protected] wrote:

Hi, is it possible to convert TextInput values to interger (float) and later use it for drawing charts without using custumjs? I need that as in sliders.py, you could with textinput pass values for amplitude, offset, phase or freq.

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/35983972-ec12-4609-812c-682f70af297a%40continuum.io.

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

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/5db51452-8452-4ff0-bac8-66360d961a32%40continuum.io.

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

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/74CFAC7B-DE0D-432C-8242-5522AA22D1A0%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi, this forum is intended for questions specific to Bokeh. I don't say that to be mean, but because it's already basically impossible to keep up with the volume of questions here already. We are (a very few) human beings who only have the same 24 hours in a day that everyone else has, so we have no choice but to politely request to keep this forum focused and on-topic.

Here is an example, but please take general non-Bokeh programming questions to another more general programming forum in the future (e.g. StackOverflow or other):

  In [1]: s = "10"

  In [2]: int(s)
  Out[2]: 10

  In [3]: float(s)
  Out[3]: 10.0

Thanks,

Bryan

···

On Aug 4, 2016, at 12:30 PM, Andrejus Antoninovas <[email protected]> wrote:

Any simple example? I am just starting coding in python so it's hard for me to combine python and bokeh coding.

On Thu, Aug 4, 2016 at 2:34 PM, Bryan Van de Ven <[email protected]> wrote:
I missed the "without" in your OP. To convert the value of a text input to a number you can:

* Write a bokeh server app, and use standard python int(), float() functions
* Use a CustomJS callback, that uses the JS function I linked below
* Write a custom Bokeh extension (http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html\)

There are many ways to do this conversion, which is why there is nothing "built-in" to perform such a conversion.

Bryan

> On Aug 4, 2016, at 2:39 AM, Andrejus Antoninovas <[email protected]> wrote:
>
> "Certainly" - how? In sliders.py expample it don't show how from textinput you could get number(int, float) and then use to make graphs. Do i have to write a def for coverting textinput (string) to int(float)?
>
>
> On Monday, July 25, 2016 at 6:08:01 PM UTC+3, Bryan Van de ven wrote:
> Certainly, but this is really a JavaScript question, not a Bokeh one. That said, I imagine this is what you want:
>
> JavaScript parseInt() Method
>
> Thanks,
>
> Bryan
>
>
> > On Jul 24, 2016, at 2:28 AM, andrejusa...@gmail.com wrote:
> >
> > Hi, is it possible to convert TextInput values to interger (float) and later use it for drawing charts without using custumjs? I need that as in sliders.py, you could with textinput pass values for amplitude, offset, phase or freq.
> >
> > --
> > 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+un...@continuum.io.
> > To post to this group, send email to bo...@continuum.io.
> > To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/35983972-ec12-4609-812c-682f70af297a%40continuum.io\.
> > For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
>
>
> --
> 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/5db51452-8452-4ff0-bac8-66360d961a32%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/74CFAC7B-DE0D-432C-8242-5522AA22D1A0%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/CAJsoxNmQgG4CgbZq%3D15XjLkRvPWponRwej3rN7adrzj_MheXvg%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.