-
Notifications
You must be signed in to change notification settings - Fork 5
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
Figures matching a "then" query that wraps the end of the dance are displayed in dance order #553
Comments
Good catch! Thank you. |
There's no special rendering to note that the match wraps. Perhaps we should consider that? See contradb#553
There's no special rendering to note that the match wraps. Perhaps we should consider that? See contradb#553
Set uses Hash as storage. Hashes enumerate their values in the order that the corresponding keys were inserted. The latter is in the language specification. The former may be an implementation detail (woof). Consider reimplementing the DanceDatatable.matching_figures_for_* methods to return Arrays of SearchMatch when order is important. See contradb#553
So I've gotten this working, but it's a little hacky, depending on the implementation of the I'm exploring using |
My fix does not work for all queries. matching_figures Box the Gnat Contra ["then", ["not", ["figure", "swing"]], ["figure", "box the gnat"]] = #<Set: {|0-1%7|, |6/0%7|}> Ideally, this would flatten as
matching_figures Box the Gnat Contra ["figure", "box the gnat"] = #<Set: {|0%7|, |1%7|}>
matching_figures Box the Gnat Contra ["figure", "box the gnat"] = #<Set: {|0%7|, |1%7|}>
matching_figures Box the Gnat Contra ["then", ["figure", "box the gnat"], ["figure", "box the gnat"]] = #<Set: {|0-1%7|}>
matching_figures Box the Gnat Contra ["figure", "chain"] = #<Set: {|6%7|}>
matching_figures Box the Gnat Contra ["figure", "box the gnat"] = #<Set: {|0%7|, |1%7|}>
matching_figures Box the Gnat Contra ["then", ["figure", "chain"], ["figure", "box the gnat"]] = #<Set: {|6/0%7|}>
matching_figures Box the Gnat Contra ["and", ["then", ["figure", "box the gnat"], ["figure", "box the gnat"]], ["then", ["figure", "chain"], ["figure", "box the gnat"]]] = #<Set: {}> |
I'm gonna go over this again, to make sure we understand each other. I think we do! @chetgray writes
You mean it would be best if it flattened to [6,0,1], right? The problem comes when it presents matching figures in a way that leads viewers to believe they're contiguous but that are actually not: The interface spits out:
but this isn't any 3 contiguous figures in Box the Gnat Contra! We'd much rather strategically arrange it to this:
And the best possible rendering would probably be something like this: The two vertical lines show individual search_matches/patches. The horizontal line warns that you're wrapping from the B2 to the A1. I thought about spending the time to build those extra visualization tools, but I wasn't sure if there'd be demand, or if it'd be intuitive for people. I'm glad you noticed! I didn't think anyone would. :) @chetgray writes
You mean even when they're overlapping, like Or do you really mean 'abuts', as if |
Other thoughts:
|
Example:
Turn on the Figures results column.
Search for dances with a circle then a progression then a circle.
The matching figures for Have I Danced this Before? are rendered as:
That dance has the circle right and turn to progress at the end of the B2, and the circle left at the beginning of the A1.
#319 #419
The text was updated successfully, but these errors were encountered: