influxdata / giraffe

A foundation for visualizations in the InfluxDB UI
https://influxdata.github.io/giraffe/
MIT License
182 stars 33 forks source link

Visualization: TableLayer: update interface to avoid double parsing #787

Open TCL735 opened 2 years ago

TCL735 commented 2 years ago

The way it is now: Some applications that consume Giraffe will do the parsing of a fluxResponse as part of the response handling prior to any interaction with Giraffe. For such applications, rendering a TableLayer through Giraffe means re-sending the fluxResponse to Giraffe, which in turn parses it slightly differently for TableLayer to consume. Thus, there is double parsing. This is very costly for ui performance.

Proposal: Avoid double parsing. Giraffe's config interface should allow TableLayer to optionally accept another data property to avoid double parsing.

Considerations: Keep TableLayer backwards compatible by continuing to allow it to use fluxResponse. This is for open source users.

TCL735 commented 1 year ago

The table-specific parser is not handling edge cases correctly. Here is an example csv where an extra "undefined" table appears. There's newlines within each row of data that is potentially causing the problem.

2022-09-30_09_35_influxdb_data.csv