Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can change it to put any png file containing your logo. Note that you MUST keep the naming (and hence you must use the png format).

If you are using DatafariUI bundled with Datafari and the default installation path, the file is located at:

...

You can change it to put any png file containing your logo. Note that you MUST keep the naming (and hence you must use the png format).

If you are using DatafariUI bundled with Datafari and the default installation path, the file is located at:

...

This image should be minimum 1920px width and max 65px height. Note that you MUST keep the naming (and hence you must use the png format).

Customizing Displayed Facets and Elements

...

Code Block
languagejson
{
      "type": "FieldFacet",
      "title": "Extension",
      "field": "extension",
      "op": "OR",
      "minShow": 2,
      "maxShow": 5,
      "show": true,
      "sendToSolr": true
    },

Parameters

Name

Optional

Default value

Description

title

The title showed at the top of the facet

field

The solr field associated to the facet

op

Operator, either “OR” or “AND”. Tells how documents are shown when selecting multiple entries in the facet. If “OR” documents need to have at least one selected element in the concerned field to be selected. If “AND” they need to have all selected elements as part of the concerned field

minShow

The maximum number of elements that are shown if the facet is not expanded

maxShow

The maximum number of elements that are shown if the facet is expanded (after clicking show more)

variant

yes

checkbox

Specify the type of FieldFacet to use. It can take these values :

  • checkbox : use classic FieldFacet with a checkbox list

Image Modified
  • autocomplete

Image Modified

show

yes

true

True to display the FieldFacet in the left panel. This option is only an UI effect. The facet is still registered as a field facet in the query.

sendToSolr

yes

false

Set to true to force the query to Solr even if show is false (keep in mind that if show is true, the facet is queried whatever the value of the sendToSolr parameter). Required to be true for the use of field facet tabs (https://datafari.atlassian.net/wiki/spaces/DATAFARI/pages/2625634305/Customizing+DatafariUI#Search-Tabs ), which is its only purpose for now.

QueryFacet:

A query facet displays a facet tied to provided queries with the possibility to filter results based on those queries. It can include children components, providing the ability for the user to provide a custom query. In the example below, we present a way to provide a custom date range.

...

From ui-config.json file, you can customize the following parameters of the chart :

Name

Description

type

Facet type set to RangeFacet

title

i18n facet title

field

Solr field to bind

start

Solr range start

end

Solr range end

gap

Solr range gap

yDataKey

Key used to format data and used to display the Y bar legend. Key is i18n.

ranges (Optional)

Array of predefined integer ranges to get as much as radio button selection to give to the brush tool a predefined range. Default is an empty array and the ranges controls are hidden.

rangeLabel (Optional)

i18n label next to range value

showBrushBounds (Optional)

true to display the brush bounds under the brush tool. Default is false

barFillColor (Optional)

Bar fill color. Default is #679439AA (smooth green)

brushStrokeColor (Optional)

brush stroke color (range selection tool under the graph). Default is #679439 (smooth green)

Configuration example include in left facet :

...

The RangeBarChart component can be embed into any other component like the RangeFacet that displays the graph as a facet with a maximal height. This component uses the following props :

Prop name

Type

Description

data

Array

an array of objects that represents the data to be displayed in the graph. The minimal object structure must be as follows :

Code Block
languagejsx
{ "x_datakey": "x_value", "y_datakey": "y_value" }

Example :

Code Block
languagejsx
const chartData = [   
  { name: '01/02/2022', doc: 300 },   
  { name: '02/02/20222', doc: 145 }
]

X labels will be based on x_datakey value. The legend for Y axis will be based on x_datakey name (not the value!). Each axis is auto scale.

With the previous example, the dates are used for X labels. doc appears in the legend on top. But you can use any type of values as well :

Code Block
languagejsx
const chartData = [   
  { index: 1, price: 1000 },   
  { index: 2, price: 350 }
]

xDataKey

string

Name of the field in the data array object for X axis

yDataKey

string

Name of the field in the data array object for Y axis

maxHeight

number|string

Max height of the graph. Default is 100%

width

number|string

Width of the graph. Default is 100%

startIndex

number

Start index of the brush tool

endIndex

number

End index of the brush tool

brushStrokeColor

string

CSS color of the brush tool stroke. Default is #679439

barFillColor

string

CSS color of the chart bar. Default is #679439AA

xTickFormater

function<value>:string

A function that takes the X axis label value and returns a formatted value. Default is undefined.

brushLabelFormatter

function<value>:string

A function that formats the brush label as you will. Default returns the current value

onSelectChanged

function<startIndex, endIndex>:void

A function called when the user has changed the brush selection.

Customize Search Bar component

...

The searchBar has the following parameters :

Name

Description

suggesters

Array of suggesters.

Several suggesters can be added, even if they are of the same type : you can add 2 entity suggesters but with different field/suggester.

Each suggester result will be displayed in a dedicated section below the search bar.

Available suggester types and their parameters are presented below

backdrop

Enable / Disabled the backdrop behind the search bar when it is focused. Default is false (no backdrop).

Available suggesters

There are 3 types of suggesters :

...

From ui-config.json file, you can customize the fields you send to Solr. queryParams is an object which can have the following keys :

Key name

description

Default value

fields

An array of string that define fields sent to solr for each query.

Code Block
languagejson
"fields": [
      "title",
      "url",
      "id",
      "extension",
      "preview_content",
      "last_modified",
      "crawl_date",
      "author",
      "original_file_size",
      "emptied",
      "repo_source"
    ]

useHotkey hook

This hook allows to define a hotkey with one command key plus an optional second letter key.
Command keys are defined as below (case sensitive) :

...