How to Publish/Subscribe Events using Custom Javascript Views

Hey @mayurin,

Glad the info was helpful and really cool that you got the selection events working :slight_smile: Currently, you can use either the “Interactive Value Filter Widget” (for Nominal Filtering) or the “Interactive Range Slider Filter Widget” (for Range-based filtering) with many of our existing visualization nodes. If you want to filter NOMINAL or RANGE based tables with custom implementations via the Generic JavaScript View, I would check out the source here for inspiration.

With the existing functionality you can use functionality provided by the knimeDataTable API to apply the filter to the data table in the view. Check out the source for that API here. Methods like isValueIncludedInFilterElementRangeand isRowIncludedInFilter make it really simple to apply the filters matching the existing filter API to the data within a view.

I hope this helps! :slight_smile:

Of course, if you want to get tricky and implement your own custom filters, this is possible too. For an example, I hacked together a searchable column filter using two “Generic JavaScript View” nodes within a component (attached at the bottom of this post). I used the “Plotly Scatter Plot” template available from the node as a starting point for the visualization and then vanilla JavaScript and the knimeService API to implement some custom controls.

This allows you to filter out rows based on the letter in the input field. At the end of the day, the knimeService API acts as a general Pub/Sub service provider, so once you get the tableIds matched up, you can create more in depth filters or interactions as needed.

Let me know if you have any questions!

Best,
Ben

sample_searchable_filter.knwf (460.6 KB)

6 Likes