Package 'shinySearchbar'

Title: Shiny Searchbar - An Input Widget for Highlighting Text and More
Description: Add a searchbar widget to your 'Shiny' application. The widget quickly integrates with any existing element containing text to highlight matches. Highlighting is done with the 'JavaScript' library 'mark.js'. The widget includes buttons to cycle through multiple instances of the match and automatically scroll to the matches in an overflow element (or window). The widget also displays the total number of matches and which match is currently being cycled through. The widget is structured as a 'Bootstrap 3' input group.
Authors: Jesse Norris [aut, cre], Julian Kühnel [ctb] (mark.js)
Maintainer: Jesse Norris <[email protected]>
License: GPL-3
Version: 1.0.0
Built: 2024-11-04 03:33:15 UTC
Source: https://github.com/jes-n/shiny-searchbar

Help Index


Configuration Options List for mark.js API

Description

All API options for mark.j v8.11.1, excluding the callback functions: each, filter, noMatch, and done.

Usage

configurator

Format

List with 15 named elements.

element

Element tag to wrap matches, default is "mark".

className

Class named appended to the match element, default is "".

exclude

Vector of element selectors to exclude from match, default is c().

accuracy

Match algorithm ("partially", "complementary", or "exactly"), default is "partially". (see mark.js API for more details).

synonyms

List of key-value pairs to consider equivalent, default is list().

ignorePunctuation

Vector of punctuation marks to ignore, default is c().

wildcards

Matching using wildcards such as "?" and "*" ("disabled", "enabled", or "withSpaces"), default is "disabled" (see mark.js API for more details).

iframes

Search within iframe elements, default is FALSE.

iframesTimeout

Maximum time (in ms) to wait for load before skipping an iframe element, default is 5000.

seperateWordSearch

Search for each space-seperated word instead of the complete input, default is TRUE.

diacritics

Match using diacritic characters, default is TRUE.

acrossElements

Search for matches across elements, default is FALSE.

caseSensitive

Case sensitive matching, default is FALSE.

ignoreJoiners

Skip soft hyphen, zero width space, zero width non-joiner and zero width joiner, default is FALSE.

debug

Print debug information to the brower's console, default is FALSE.

Details

See the mark.js API for a detailed description of each option. Also see the mark.js Configurator for these options in action.


Shiny Searchbar Demos

Description

Run one of the the shinySearchbar demos: "gallery" and "overflow".

Usage

demo(name = "gallery", ...)

Arguments

name

Name of the demo, either "gallery" or "overflow".

...

Remaining arguments are passed to shiny::runApp, e.g. 'port', 'display.mode', etc.

Examples

if (interactive()) {
  shinySearchbar:::demo("gallery")
}

Update mark.js Options for an Initialized Searchbar Widget

Description

Only the options explicitly passed with this function are updated, the previous options are left unchanged.

Usage

updateMarkOptions(
  inputId,
  markOpts,
  session = shiny::getDefaultReactiveDomain(),
  quiet = FALSE
)

Arguments

inputId

The input slot of the initialized searchbar widget.

markOpts

Options to update for mark.js API.

session

The session object passed to function given to shinyServer.

quiet

Supress any warning related to incorrect/invalid arguments.

Value

No return value, called to update markOpts of the input control.

See Also

configurator