datawave icon indicating copy to clipboard operation
datawave copied to clipboard

Query metric query formatting - colors, themes, and parens matching

Open ivakegg opened this issue 3 years ago • 3 comments

I would be nice to be able to hover over a paren in the query or query plan and to see where the matching parenthesis is. Both by highlighting and then if you click on the paren it takes you to the matching one. The thought is that this can be done with a decorator on the jexl formatted string visitor such that we can apply other decorators for other circumstances. For example a terminal (bash) decorator that applies coloring based on depth of the node or other such decorations.

ivakegg avatar Jun 14 '22 11:06 ivakegg

Parens matching would be great. You could probably get away with doing that solely in javascript on the metrics html page.

To broaden this idea a bit, it might be nice to identify the various elements of a query (e.g. fields, numeric values, quoted values, geohashes, functions, query property markers, etc.) and come up with a color scheme that could be used to format each of these elements. Ideally, we would be able to easily swap between different themes and color schemes (some people might find one theme more readable than another).

jwomeara avatar Jun 14 '22 13:06 jwomeara

Created a commit for the interactive matching parenthesis functionality. See: https://github.com/NationalSecurityAgency/datawave-query-metric-service/pull/5

kevinrr888 avatar Jun 17 '22 17:06 kevinrr888

Updated https://github.com/NationalSecurityAgency/datawave-query-metric-service/pull/5 and created https://github.com/NationalSecurityAgency/datawave/pull/1631 for completed functionality. The updated JexlFormattedStringBuildingVisitor.java will have to be added to feature/queryMicroservices for it to work with the microservices Query Metrics page. Let me know any comments/changes.

kevinrr888 avatar Jun 24 '22 16:06 kevinrr888