Visualisation Filter

focault

Member
I have a MySQL view on mt db that works out averages of scores that users input.
I then have a list based on those tables which I have used a prefilter on to make sure users can only see their own data, this seems to work fine.
I then made some n3d charts visualisations of this but they ignore the pre filters and show data to users that is not theirs.
How would I solve this?
 
Hmmmm. Yup, looks like the nvd3 stuff doesn't apply pre-filters, it just works on raw tables, rather than Fabrik "Lists". In other words, it has you select a connection and a table, rather than a Fabrik List. And we can't then work out which List that table "belongs" to, as a) there may not even be a List for it, and b) if there is, there could be multiple lists, with different pre-filters, using the same table.

The nvd3 stuff is very much Work In Progress, which Rob has been working on as and when he has time. And obviously in his initial development (he original wrote this as a custom job for someone, I think), he didn't need pre-filters.

At the moment, the only way I can see that you'd be able to apply pre-filters would be to use the "script" option, and roll your own code to load the data. You could either do that "the Fabriok way", by loading up a specific List model, and get the list data that way, using the List model getData(), which would automagically apply pre-filters. Or by rolling your own query, which includes the user filter.

The only alternative would be for us to modify / improve the viz code, and either:

a) Modify the viz params so they have you select a Fabrik List, rather than a connection / table. This would not be backward compatible for anyone currently using the viz.

b) Add a "List" option as an alternative to specifying a connection / table (or a script).

Then you would have 3 ways of harvesting the data - raw table (allowing you to select table data for which no Fabrik list exists), Fabrik List (allowing you to get data with pre-filters applied, but only for tables for which a List exists), or doing it by hand with a script.

For either a) or b), that wouldn't be a quick fix, as we'd need to add a fair amount of code to the existing model, as there isn't a single place where we load the data, there are a number of methods in the main nvd3 model which run queries specific to the chart type.

rob?

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top