-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Provide a data table view usable via JavaScript #991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is possible. A plotly.py table is simply a regular That said, with the new plotly.js transform plugin functionality, we would pretty easy to convert the plotly.py logic in JS as a transform module. |
table
traces as a transform module
Anyone interested in doing this may want to look at #1020 first for inspiration. |
table
traces as a transform moduletable
plot / trace type
table
plot / trace type
DescriptionThere's a need for tables in the context of crossfiltering. This ticket is repurposed to
ContextWe're working on crossfiltering functionality. On an initial glance, it's just a way of letting widgets constrain dimensions and make the other widgets rerender. But there's a lot more to it - to be described elsewhere, except for the fact that showing tables is common on crossfiltered views.
The need that a table work well with crossfiltering already poses some demands, and there are general requirements toward a table widget as well. Table functionality needed for, or implied by crossfilteringThere are some direct, often obvious needs, such as:
As part of a crossfiltered dashboard, it may be necessary to show aggregate items rather than atomic details. It applies for all plots though, eg. barcharts that show total by country. It is thus expected that Crossfiltered tabular data, in principle, may contain a lot of records, for the purpose of crossfiltering is very often an affordance toward data exploration on large, multidimensional datasets. Thousands to hundreds of thousands of records are not uncommon even in the browser. On the other hand, screen size is always limited. Therefore, Question 1: does a table view need to be immediately, or in the future, be able to display any and all records, or can a row count limit be established? It is possible to make essentially infinite scrollers, but there are some tradeoffs incl. development time, or e.g. the use of When filtering on other widgets, the table needs to be updated, and, previously shown records may stay on in a different position, or rows may appear/disappear, therefore: Question 2: Is there a current, or eventual need for tweening according to the enter/update/exit lifecycle, e.g. fading in/out rows and smoothly transitioning rows that merely change location eg. in a top 10 list? (click and hold columns) There are crossfilter-relating functions that are not critical for a MVP but could be useful, therefore: Question 3: Should the user be able to select one record, a contiguous block of records, discontiguous records (and which of these) in order to filter the currently shown dataset on the dashboard? E.g. brush 10 rows, then show only these 10 points (and their aggregates) on other views. Question 4: Do we need selection of dimension value by example? E.g. right-click on a specific cell that has 'Canada', and click 'Keep (or Exclude) records where Question 5: Do we need a focus+context facility in the Interlude -
|
Writing the above, I felt less and less certain that repurposing an existing plot type such as |
For reference, @cldougl 's python figure factory: https://plot.ly/python/table/ |
This should be a first-class
Row limit sounds fine to me. SVG tables are only going to be able to show so many rows anyway. Big tables with 1000s of rows loaded are going to bog down dashboards, the workspace, Dash apps, etc.
I'd say no unless it's easy to implement.
For consistency and simplicity, it seems like we could recycle rectangular selection into tables.
There are a lot of fascinating possibilities for declarative context menus (get stats for a selection, open a selection in a new graph, etc), but we should leave that out of this project and treat it holistically with other trace types, if we even ever get to it.
Maybe hide versus restyle could be an option? Hide should be the default. See filtering on this table: http://react-grid-crossfilter.getforge.io/
This list loooks good. @cldougl 's Plotly.py tables are an excellent starting point since they've been battle-tested for a few years among plotly users and customers. I think @charleyferrari has run into some additional customer requests.
At least vertical scrolling. The crossfilter customer was happy with this table prototype, which has vertical scrolling: http://react-grid-crossfilter.getforge.io/
I'd copy this table as best you can, since the sponsoring customer already gave it a 👍 http://react-grid-crossfilter.getforge.io/
No, I'd keep this first
Going to need vector export. I wouldn't worry about @media print css.
In addition to what the Plotly.py table supports, sparklines would be awesome. Sparklines could be its own infinite rabbit hole, so I'd just make them as simple as possible to start, then let customers guide their future development.
Yes to copy-able text and screenreaders. No opinion on 3rd, except it sounds overly complicated for what we need now.
HTML implementation sounds fine to me.
Definitely. |
@etpinard @alexcjohnson @rreusser any overriding guidance on the Rendering option? (1..7) which one is OK / not OK? I spent a few hours looking into the alternatives but all options have important pros/cons |
@jackparmer Clients have brought up jQuery datatables quite a few times. It also has an R implementation that has become pretty standard for tables in Shiny. I think that would be a good place to look for specs. |
@charleyferrari yeah, I get that one all the time too 👍 This fellow even thinks we make it 😹 https://groups.google.com/d/msg/jupyter/s7OWDL7JAVY/2uSC5mDPAwAJ |
In functionality, the jQuery DataTable is leagues beyond the initial response above, it has a lot of options and affordances, so there should be a decision if we shoot for the basic thing (my initial read of Jack's response) or a DataTable-alike, even its separately downloadable list of options is sizable: https://datatables.net/download/packages - even the main DataTable source file is 500 megs, and the full enchilada (source with options, examples) is 2.5MB zipped! Besides dev time, there's the code size impact. |
@monfera yeah, DataTables is way on the other end of the complexity spectrum, sorry for not clarifying. @charleyferrari I was mainly remembering what you did here as an example for a Plotly user - augmenting the Plotly.py table with a background row color: |
@jackparmer Ah yeah, conditional formatting. I get that a lot too. Right now the figure factory doesn't seem to match the data to the formatting: it assumes you want the table pretty-formatted (unless it's an undocumented feature @cldougl added). To hack the above I just manually restyled after creating a table object. In my experience customers want it to behave like Excel, which has tons of options (coloring based on ranges or outliers, numeric scales like the one above, etc.) Going for that level of functionality would be a lot. But, if tables were a top level trace type, the data could constantly be associated with it and we could color it like a heatmap (and users can create custom color scales for excel-like conditional formatting, with a setting to toggle between pretty formatting and conditional formatting) |
yeah @charleyferrari for coloring based on data (ranges or outliers) I point people to the annotated heatmap rather than the table A big issue that I've heard a lot is editing column widths (independently) easily. |
Ok.
Not ok. Wouldn't export well.
Not ok. Wouldn't export well.
Not ok. Wouldn't export well.
Not ok. We need to support IE9 given a typedarray polyfill
Nop.
Ok. Text manipulation is harder, but it wouldn't be wasted as axis labels are in dire need of some text wrapping. So, canvas or SVG. |
👍 for SVG with an eventual plan to automatically wrap text. So many places this would be useful, I'd like to see it built into to It sounds a bit complicated to implement, but with selective rendering and aggressive caching of dimensions I'd imagine we could get reasonable performance... |
done in #2052 |
It's entirely feasible to achieve that using Plotly as a library, PHP to connect to the database (MySQL in this case), and a database. Essentially, you can create a table in Plotly by treating it as a heatmap trace with strategically positioned text annotations. However, it's worth noting that figure factories aren't directly available in plotly.js. However, with the advent of the plotly.js transform plugin functionality, you could easily port the logic from plotly.py to JavaScript as a transform module. This would allow you to replicate the functionality seamlessly in a web environment. |
No description provided.
The text was updated successfully, but these errors were encountered: