Is there a solution for column filter on wikitext tables

Anyone have an example js solution of column filtering on wikitext tables?

There’s been multiple projects with dynamic tables. A good one is Mohammad’s

You can use the “Links” in the upper right of the discourse forum to access a search engine for TW resources on the net. If you type “dynamic” or “tables” into the search you’ll find other projects with dynamic tables.

Sadly, I don’t have data in a format that currently allows for dynamic tables. I am processing ~60-100mbs of data into static wikitext tables for top performers in 30+ categories per event. I have the tables sortable via sortable.js as mentioned by Jennifer_S. I was hoping there may be a similar proven solution to allow filtering by 1 or more columns of the table.

I think you’ll have to explain more about how your data/tiddlers are configured. Like what format is that 60 mb data in now?

1 Like

http://chronicles.wiki/TW5-RenderTablePlugin/

Is this table of any use for you. This is another table I know of.

1 Like

Here is an example which uses regular expressions to transclude a tiddler and dynamically filter its rows: https://filter-static-table-dynamically.tiddlyhost.com/

It’s the most basic filtering possible and could be expanded to allow things like filtering specific column but that’s much more work :).

Edit: to add a bit more info, this is almost a drop-in solution which you can use to allow filtering any static table. All it requires to handle a different table is to change the beginning of the filter inside <$list> from [Table] to the name of the tiddler which contains the table you want to filter. Which could be made dynamic OR you could even modify TW’s template to make it so that you get such a filtering system on every tiddler.

3 Likes

Wow, that is amazing stuff!

I had assumed it would always be necessary to split the table into tiddlers in order to do anything fancier than the kind of sortable display we get from Mohammad’s very helpful quick tables.

This solution, combined with SK’s utilities (to get a data-dump formatted as wiki-markup tables, and/or to divide rows into tiddlers), is so helpful!

-Springer

This looks very interesting and would accomplish what is desired, I’ll see if I can incorporate this. Although my current output may need to be adjusted to a more tiddler-like approach(smallest unit). Currently I output one rather large tiddler per event as a summary based on a python script.

I process the bulk data (60-100mbs of json files) in python and produce an event tiddler containing way to many tables and reveal buttons along with 40 echart tiddlers per event. The event tiddler is a single file, and all the tables have been written out in |!static |!wikitext |!format | within the event tiddler. This was my fork of a job that produced a plain text file summary and the path of least resistance to me getting it up on TW5. Although it appears I may have created more work to get it to a state that is more tiddler like to take advantages of TW5 capabilities down the road. Paved with good intentions and all. I want to get to a node version, but haven’t had time to really dig into it yet.

Example out is here: https://kdr.tiddlyhost.com/#20221127-WvW-Log-Review

Some thoughts on this general issue;

With JSON mangler installed and on tiddlers with CSV rows/column you can get an easy to read table. The JSON mangler is greeat for importing CSV into independent tiddlers and you can use this to reduce rows and columns imported if you do not need all the data.

However;

  • It seems to me a powerful solution would be to enhance the CSV mime viewer to allow column filters and sort, save subset as a new CSV etc… That is keep the csv table as is, and provide these dynamic table features on top.
  • CSV is common and trivial for sourcing data.

The new JSON operators in Release 5.2.4 may permit this to be done for JSON as well.

new operators for reading and formatting JSON data: jsonget Operator, jsonindexes Operator, jsontype Operator and format Operator