feat(plot): draw uploaded annotations on the plots - #345
Open
yuhongherald wants to merge 1 commit into
Open
yuhongherald wants to merge 1 commit into
yuhongherald wants to merge 1 commit into
Conversation
Member
|
Hi, the implementation looks good, but I'm hesitant to add this. It seems better suited for the next generation of flight review (it already includes automated checks). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional Annotations field to the upload form: YAML files marking intervals of a flight,
listed in a table above the plots and drawn onto the plots they name.
Problem
A log is usually reviewed against something already known about the flight - a test sheet, an
operator's notes, the verdict of an external analyzer. That context lives outside Flight Review
today, so the reviewer reads a time off one document and hunts for it on the plot. There is no way
to put "this is the interval in question" on the page next to the data.
Solution
plot_app/annotations.pyvalidates the uploaded YAML and renders it. A file declares one or moresources, each with a colour and a set of categories; a category names a
graph(the plot's title,or a
Nav-...fragment id) and carries intervals with astart, an optionalend, and optionalannotation/valuetext. Times are read the way the x-axis is labelled, so an annotation time iswhatever you read off the plot.
400 rather than storing a half-annotated log. The result is stored as JSON in a new
Logs.Annotationscolumn, whichsetup_db.pyadds to an existing database on its next run.generate_plots, so agraphis matched against the titles the plotsactually got. Bands are drawn in a screen-unit strip below the data, the same way
plotting.pydraws the VTOL strip, so they never occlude the trace;
valuetext is revealed on hover, cappedat three stacked lines. Unmatched categories still appear in the table.
6 rows per plot). Every field is escaped on the way into the table, and hover tooltips are passed
to Bokeh as field pairs rather than as an HTML string, so uploaded text is inserted as text.
A log uploaded without annotations renders exactly as it does today; the section and the strip are
simply absent.
Adds
pyyamltoapp/requirements.txt. Format and design notes indocs/annotations.md- that is anew directory, since at 253 lines the spec would more than double the root README; happy to move or
trim it if you would rather it lived somewhere else.