Use ui-grid instead of smart-tables for table visualizations


#1

Hello guys,

Here we use the table visualization a lot.
I found a lack of personalization on the table visualization. Indeed we haven’t at all.

I started thinking in enhancing the smart-tables directive. Then I though again.
I ended up with the idea of replacing it with ui-grid.

What do you guys think?

UPDATE
Forgot the link: http://ui-grid.info/


#2

Same here, we’re heavy users of jQuery datatable which has a lot of features.
Within Angular eco system ui-grid seems to be the first choice.

We have it already implemented as a new visualization (1.0 Rc2)
Now I need confirmation / feedback that it makes sense to clean it up and create a PR for it …


What new visualizations would you like to see in Redash?
#3

Can you share a few screenshots of how it looks like?

Is your implementation public somewhere?


#4

Hi,

I haven’t published yet (still work in progress).
But I embedded the ui grid together with the following features:

  • pinning left/right (switch on/off via visualization editor)
  • customizable column widths (via visualization editor)
  • optional column sum (switch on/off via visualization editor)
  • optional record count (switch on/off via visualization editor)
  • filtering per column
  • multi sorting per column
  • vertical and horizontal scrolling (no pagination implemented for now)


#5

is there any interest in this feature?
If not I’ll just leave it in our private fork of redash.


#6

There is! Looks like you implemented many features beyond just ui-grid.

The screenshot in your previous post didn’t publish. Can you try publishing it again?

Thanks!


#7

strange the screenshot was definitly there …

Ok then I’ll prepare a PR for that.

And I keeping my fingers crossed for the 1.0 release :wink:


#8


#9

Looks great! Would love to use it in my projects.


#10

Hey @majofi
I just upgraded to 1.0Rc2, but couldn’t find the new DTable visualization. Have I missed some step while upgrading?


#11

Looking forward :thumbsup:

I would love to see the code implications, so feel free to create a pull request even before it’s ready (just mark it as WIP - work in progress) or just send a link to your branch.


#12

will do, I can already say that code implication are very tiny, adding new visualizations is very simple … could become some kind of plugin system in the future …


#13

Hi @majofi, do you have a fork somewhere with this implemented? Would love to take a look, even if it’s a work in progress. The ui-grid interface looks really nice.


#14

Hi lrp,

my fork is here:


…already working.

Right now I’m looking if there are any tests for visualizations in redash, can please anyone point me to the right place?
Or are there no tests for visualizations yet ? In that case I might need to create a PR without tests as I’m not sure that I know whats the best approach is to test such a thing …


#15

PR created:


#16

It’s embarrassing, but the UI side has no test coverage :cry:.


#17

easier for me with the PR :wink: … is there a guide anywhere regarding the unittests? I manage to get them running but I have some failures on current master.