Skip to content

Commit 3a00a7b

Browse files
committed
Add initial filtering help
1 parent 95e728c commit 3a00a7b

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

src/CSET/cset_workflow/app/finish_website/file/html/index.html

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,52 @@ <h1>CSET</h1>
1717
<button id="clear-query">⌫ Clear search</button>
1818
<button id="description-toggle">⇲ Hide description</button>
1919
<search>
20+
<details>
21+
<summary>Filter help</summary>
22+
<p>
23+
The filter consists of a space separated list of conditions.
24+
A diagnostic is shown if <em>all conditions are true</em>.
25+
Each condition takes the form:
26+
</p>
27+
<!-- <code>[ facet ] [ : | = | &lt; | &gt; | &lt;= | &gt;= ] value</code> -->
28+
<code>[ facet ] [ operator ] value</code>
29+
<p>
30+
Where the facet is the name of the attribute of the diagnostic to test, and the operator is one of:
31+
</p>
32+
<dl>
33+
<dt>:</dt>
34+
<dd>A colon tests whether the value is <em>in</em> (is a substring of) the facet.</dd>
35+
<dt>=</dt>
36+
<dd>An equals sign tests whether the value is <em>exactly equal</em> to the facet.</dd>
37+
<dt>&lt;, &gt;, &lt;=, &gt;=</dt>
38+
<dd>A less-than, greater-than, less-than-or-equal or greater-than-or-equal sign tests whether the value sorts before or after the facet, allowing for ranges of dates and numbers.</dd>
39+
</dl>
40+
<p>
41+
If no facet is specified it defaults to checking the value is in the title, equivalent to <code>title:value</code>.
42+
Values may be quoted to include special characters, such as spaces.
43+
</p>
44+
<p>Conditions may be combined with <code>AND</code> or <code>OR</code>, or prefixed with <code>NOT</code> to get the inverse.</p>
45+
<h3>Examples</h3>
46+
<dl>
47+
<dt>histogram</dt>
48+
<dd>"histogram" in the title.</dd>
49+
<dt>title:"air temperature"</dt>
50+
<dd>"air temperature" in the title.</dd>
51+
<dt>field:temperature</dt>
52+
<dd>"temperature" in facet "field".</dd>
53+
<dt>field=temperature</dt>
54+
<dd>"temperature" exactly matches field.</dd>
55+
<dt>NOT temperature</dt>
56+
<dd>Not "temperature" in title.</dd>
57+
<dt>field=x_wind OR field=y_wind</dt>
58+
<dd>field does not equal "x_wind" or "y_wind".</dd>
59+
<dt>histogram AND field:temperature</dt>
60+
<dd>"histogram" in title and "temperature in facet "field".</dd>
61+
<dt>(histogram AND field:temperature) OR (time_series AND field:humidity)</dt>
62+
<dd>Histograms of temperature and time series of humidity. Parenthesis indicate precedence.</dd>
63+
</dl>
64+
</details>
2065
<input type="search" name="query" id="filter-query" placeholder="Filter...">
21-
<!-- TODO: Add help for query syntax. -->
2266
<fieldset id="filter-facets">
2367
<legend>Search facets</legend>
2468
</fieldset>

src/CSET/cset_workflow/app/finish_website/file/html/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ nav {
4242
}
4343

4444
>search {
45+
dt {
46+
font-family: monospace;
47+
}
48+
4549
#filter-query {
4650
width: 100%;
4751
padding: 0.5em 1em;

0 commit comments

Comments
 (0)