diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 420812f3f..d22beba73 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -546,6 +546,18 @@ The following options are available: - third - quarter +### Tooltips +Use the `{{< tooltips >}}` shortcode to add tooltips to text. +The **1st** argument is the text shown in the tooltip. +The **2nd** argument is the highlighted text that triggers the tooltip. + +```md +I like {{< tooltip "Butterflies are awesome!" "butterflies" >}}. +``` + +The example above renders as "I like butterflies" with "butterflies" highlighted. +When you hover over "butterflies," a tooltip appears with the text: "Butterflies are awesome!" + ### Reference content The InfluxDB documentation is "task-based," meaning content primarily focuses on what a user is **doing**, not what they are **using**. diff --git a/content/v2.0/reference/key-concepts/data-elements.md b/content/v2.0/reference/key-concepts/data-elements.md index 89cb7484f..09f62a8b1 100644 --- a/content/v2.0/reference/key-concepts/data-elements.md +++ b/content/v2.0/reference/key-concepts/data-elements.md @@ -31,12 +31,12 @@ _Hover over highlighted terms to get acquainted with InfluxDB terminology and la **bucket:** `my_bucket` -| _time | _measurement | location | scientist | _field | _value | -|:------------------- |:------------ |:------- |:------ |:-- |:------ | -| 2019-08-18T00:00:00Z | census | klamath | anderson | bees | 23 | -| 2019-08-18T00:00:00Z | census | portland | mullen | ants | 30 | -| 2019-08-18T00:06:00Z | census | klamath | anderson | bees | 28 | -| 2019-08-18T00:06:00Z | census | portland | mullen | ants | 32 | +| _time | _measurement | {{< tooltip "Tag key" "location" >}} | {{< tooltip "Tag key" "scientist" >}} | _field | _value | +|:------------------- |:------------ |:------- |:------ |:-- |:------ | +| 2019-08-18T00:00:00Z | census | klamath | anderson | bees | 23 | +| 2019-08-18T00:00:00Z | census | portland | mullen | ants | 30 | +| 2019-08-18T00:06:00Z | census | klamath | anderson | bees | 28 | +| {{< tooltip "Timestamp" "2019-08-18T00:06:00Z" >}} | {{< tooltip "measurement" "census" >}} | {{< tooltip "Tag value" "portland" >}} | {{< tooltip "Tag value" "mullen">}} | {{< tooltip "Field key" "ants" >}} | {{< tooltip "Field value" "32" >}} | ## Timestamp @@ -117,19 +117,19 @@ from(bucket: "bucket-name") InfluxDB scans every field value in the dataset for `bees` before the query returns a response. If our sample `census` data grew to millions of rows, to optimize your query, you could rearrange your [schema](/v2.0/reference/glossary/#schema) so the fields (`bees` and `ants`) becomes tags and the tags (`location` and `scientist`) become fields: -| _time | _measurement | bees | _field | _value | -|:------------------- |:------------ |:------- |:-- |:------ | -| 2019-08-18T00:00:00Z | census | 23 | location | klamath | -| 2019-08-18T00:00:00Z | census | 23 | scientist | anderson | -| 2019-08-18T00:06:00Z | census | 28 | location | klamath | -| 2019-08-18T00:06:00Z | census | 28 | scientist | anderson | +| _time | _measurement | {{< tooltip "Tag key" "bees" >}} | _field | _value | +|:------------------- |:------------ |:------- |:-- |:------ | +| 2019-08-18T00:00:00Z | census | 23 | location | klamath | +| 2019-08-18T00:00:00Z | census | 23 | scientist | anderson | +| 2019-08-18T00:06:00Z | census | {{< tooltip "Tag value" "28" >}} | {{< tooltip "Field key" "location" >}} | {{< tooltip "Field value" "klamath" >}} | +| 2019-08-18T00:06:00Z | census | 28 | scientist | anderson | -| _time | _measurement | ants | _field | _value | -|:------------------- |:------------ |:------- |:-- |:------ | -| 2019-08-18T00:00:00Z | census | 30 | location | portland | -| 2019-08-18T00:00:00Z | census | 30 | scientist | mullen | -| 2019-08-18T00:06:00Z | census | 32 | location | portland| -| 2019-08-18T00:06:00Z | census | 32 | scientist | mullen | +| _time | _measurement | {{< tooltip "Tag key" "ants" >}} | _field | _value | +|:------------------- |:------------ |:------- |:-- |:------ | +| 2019-08-18T00:00:00Z | census | 30 | location | portland | +| 2019-08-18T00:00:00Z | census | 30 | scientist | mullen | +| 2019-08-18T00:06:00Z | census | {{< tooltip "Tag value" "32" >}} | {{< tooltip "Field key" "location" >}} | {{< tooltip "Field value" "portland" >}} | +| 2019-08-18T00:06:00Z | census | 32 | scientist | mullen | Now that `bees` and `ants` are tags, InfluxDB doesn't have to scan all `_field` and `_value` columns. This makes your queries faster. @@ -137,10 +137,10 @@ Now that `bees` and `ants` are tags, InfluxDB doesn't have to scan all `_field` Now that you're familiar with measurements, field sets, and tag sets, it's time to discuss series keys and series. A **series key** is a collection of points that share a measurement, tag set, and field key. For example, the [sample data](#sample-data) includes two unique series keys: -| _measurement | tag set | _field | -|:------------- |:------------------------------- |:------ | -| census | location=klamath,scientist=anderson |bees| -| census | location=portland,scientist=mullen | ants | +| _measurement | tag set | _field | +|:------------- |:------------------------------- |:------ | +| census | {{< tooltip "Tag set" "location=klamath,scientist=anderson" >}} | {{< tooltip "Field key" "bees" >}} | +| census | location=portland,scientist=mullen | ants | A **series** includes timestamps and field values for a given series key. From the sample data, here's a **series key** and the corresponding **series**: diff --git a/layouts/shortcodes/tooltip.html b/layouts/shortcodes/tooltip.html new file mode 100644 index 000000000..29dcae824 --- /dev/null +++ b/layouts/shortcodes/tooltip.html @@ -0,0 +1,3 @@ +{{ $tooltip := .Get 0 }} +{{ $text := .Get 1 }} +{{ $text }}