Edit documentation Edit document
GH-Elements

JSON Constructor Element

JSON Constructor is a gh-element that allows to open the scheme editor. There user can use the jsonConstructor method. You can read about that in JSON Constructor Overview

Functional Characteristics

This gh-element is used to create a scheme by which the JSON will be generated. JSON Constructor is also used in nodes. So you can use it to create various requests.

Value Format

JSON constructor does not have any field value.

Element Options

This element has only one group of settings called Field Settings. There two standard options and an extra one.

Settings of JSON constructor field

Name Description
Color allows to select the button color; details...
Saving allows to configure the saving of the created scheme; details...

Color

Since JSON constructor element is a special button, it have the function that allows to change its color. Accordingly, it works only with the first interpretation type.

Saving

If this function is enabled, the created scheme will be saved in the GudHub database. In the other case, when the user exits the scheme editor, the scheme will be deleted.

Element Style

JSON constructor element has not a lot of extra options. There are only one in General Settings. All others are the standard settings which are described in Setting Overview. Also, you can read about element interpretation types below.

Style of JSON constructor element

General Settings

The constructor has one additional style option, which is in the general settings.

General settings of JSON constructor style

Name Description
Particulary editable allows to make scheme in editor uneditable

Particulary editable

This function allows you to remove the type block from the Scheme Editor with all entities, and make it display only the JSON schema.

  • True

    Scheme editor when Particulary editable is on

  • False

    Scheme editor when Particulary editable is off

Data Model

There are only a few properties in its data model.

{
    "data_model": {
        "color": "#0893d2",
        "interpretation": [],
        "save": 1,
        "scheme": []
    }
}
Name Type Description
color string contains the hex code of button color
interpretation array contains all element interpretations
save boolean shows whether the created scheme is saved in GudHub or not
scheme array contains the scheme that is contained in the editor

Filtration

Since this element does not have field value, it also cannot be filtered out.

Interpretation

This element has only two interpretation types.

Types of JSON constructor interpretation

Editor

This is an interpretation type that allows to display the element as a button. Its action is to open the scheme editor.

Default

Due to this type the element will be displayed as icon that has no action.