Typescript syntax with bokeh server

I am trying to extend a JavaScript library that also uses a template file per some of the examples documented at Extending Bokeh — Bokeh 2.4.2 Documentation in bokeh server. Currently I am having trouble with the template file syntax. As an example I simply copied the contents of the three example files for making a custom widget into main.py, extensions_ion_range_slider.coffee, and extensions_ion_range_slider_template.ts all located in the same folder. The main.py file was adjusted slightly to be run with the bokeh server using curdoc().add_root(layout) instead of show(layout).

Running the code with bokeh serve ./ works, but when navigating to the page in a browser I get the error: bokeh.util.compiler.CompilationError: C:/Projects/ionRangeSlider/extensions_ion_range_slider_template.ts:12:22:’>’ expected. That particular line reads:

title = <label for={props.id}> {props.title}: </label> and the error seems to expect the opening label tag to end without any additional properties. I am not very familiar with typescript at the moment, but could someone please explain what I am missing to get this example working?

-Andrew

Hi,

···

On Sun, May 7, 2017 at 12:57 AM, [email protected] wrote:

title = <label for={[props.id](http://props.id)}> {props.title}: </label> and the error seems to expect the opening label tag to end without any additional properties. I am not very familiar with typescript at the moment, but could someone please explain what I am missing to get this example working?

I am trying to extend a JavaScript library that also uses a template file per some of the examples documented at http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html in bokeh server. Currently I am having trouble with the template file syntax. As an example I simply copied the contents of the three example files for making a custom widget into main.py, extensions_ion_range_slider.coffee, and extensions_ion_range_slider_template.ts all located in the same folder. The main.py file was adjusted slightly to be run with the bokeh server using curdoc().add_root(layout) instead of show(layout).

Running the code with bokeh serve ./ works, but when navigating to the page in a browser I get the error: bokeh.util.compiler.CompilationError: C:/Projects/ionRangeSlider/extensions_ion_range_slider_template.ts:12:22:‘>’ expected. That particular line reads:

this syntax can be used only in in *.tsx files (TypeScript with JSX syntax).

Mateusz


-Andrew

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/981b2804-2448-45d5-af54-42ef2c66d9ce%40continuum.io.

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

Thanks, that does the trick. I must have missed the file naming instructions originally in the documentation.

···

On Monday, May 8, 2017 at 8:43:50 AM UTC-4, mateusz.paprocki wrote:

Hi,

On Sun, May 7, 2017 at 12:57 AM, [email protected] wrote:

title = <label for={[props.id](http://props.id)}> {props.title}: </label> and the error seems to expect the opening label tag to end without any additional properties. I am not very familiar with typescript at the moment, but could someone please explain what I am missing to get this example working?

I am trying to extend a JavaScript library that also uses a template file per some of the examples documented at http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html in bokeh server. Currently I am having trouble with the template file syntax. As an example I simply copied the contents of the three example files for making a custom widget into main.py, extensions_ion_range_slider.coffee, and extensions_ion_range_slider_template.ts all located in the same folder. The main.py file was adjusted slightly to be run with the bokeh server using curdoc().add_root(layout) instead of show(layout).

Running the code with bokeh serve ./ works, but when navigating to the page in a browser I get the error: bokeh.util.compiler.CompilationError: C:/Projects/ionRangeSlider/extensions_ion_range_slider_template.ts:12:22:‘>’ expected. That particular line reads:

this syntax can be used only in in *.tsx files (TypeScript with JSX syntax).

Mateusz


-Andrew

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/981b2804-2448-45d5-af54-42ef2c66d9ce%40continuum.io.

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