Skip to main content

Markup

Datagrok Markup is a lightweight scripting language used in both the Flex View and Markup viewer. Using Markup, you can combine text narrative, calculations, and Datagrok UI elements like viewers or widgets within a single view.

Unlike traditional programming languages, Markup is intuitive and does not require extensive coding knowledge.

Expressions​

To embed an expression, use: #{expression}

Supported expressions
DescriptionExpressionOutput
Any entityx.196900d0-f9e0-11e7-c473-6fef20f86714."Andrew"Andrew
Functionx.MissingValuesImputationMissingValuesImputation
Aggregationst.aggr.sum($AGE)267266.00
Datedate2018-03-07 22:53:01.423700
Table namet.namedemog
Table tagt.tags[source.file]demog.xlsx
Row countt.rowCount5850
Selected rows countt.selection.trueCount55
Filtered rows countt.filter.trueCount5850
Current filterst.rows.filters
Current rowt.currentRow12
Current columnt.currentColUSUBJID
Current cellt.currentCellX0273T21000400001
Current row valuet.row[USUBJID]X0273T21000200001
Colorcolor(AGE)#e5e5ff
Formulaformula(${AGE} * 2)116
Value editort.editor[USUBJID]
Statisticst.stats.avg(AGE)45.69
Chartchart{"type":"Histogram","look":{"valueColumnName":"AGE"}}

Any entity​

Shows any platform entity.

Format:

x.<id>."<name>"

Function​

Shows function.

Format:

x.<name>.<option>

Options:

  • run - runs action by click.
  • link - renders as a link to function that runs action by click.

Aggregations​

Shows aggregated value of defined column.

Format:

t.aggr<aggregation>($<column name>)
AggregationsDescription
countNumber of rows
#valuesNumber of not null values
#uniqueNumber of unique values
#nullsNumber of nulls
minMinimum
maxMaximum
sumSum
medMedian
avgAverage
stdevStandard deviation
varianceVariance
skewSkewness
kurtKurtosis
q1First quartile
q2Second quartile
q3Third quartile

Date​

Shows current date and time.

Format:

date

Table name​

Shows table name.

Format:

t.name

Table tag​

Shows table tag.

Format:

t.tags[<tag name>]

Row count​

Shows number of rows.

Format:

t.rowCount

Selected rows count​

Shows number of selected rows.

Format:

t.selection.trueCount

Filtered rows count​

Shows number of filtered rows.

Format:

t.filter.trueCount

Current filters​

Shows list of selected filters.

Format:

t.rows.filters

Current row​

Shows current row index.

Format:

t.currentRow

Current column​

Shows current column index.

Format:

t.currentCol

Current cell​

Shows current cell value.

Format:

t.currentCell

Current row value​

Shows current row value in selected column.

Format:

t.row[<column name>]

Color​

Shows column's color in HEX format (32 bits).

Format:

color(<column name>)

Formula​

Shows result of defined formula, see formulas format there.

Format:

formula(<formula>)

Value editor​

Shows text input of specified column in selected row.

Format:

t.editor[<column name>]

Statistics​

Shows aggregated value of defined column.

Format:

t.stats.<statistics>(<column name>)
StatisticsDescription
countNumber of rows
#valuesNumber of not null values
#uniqueNumber of unique values
#nullsNumber of nulls
minMinimum
maxMaximum
sumSum
medMedian
avgAverage
stdevStandard deviation
varianceVariance
skewSkewness
kurtKurtosis
q1First quartile
q2Second quartile
q3Third quartile

Chart​

Chart markup allows to embed any of Viewers into page.

Format:

chart{"type":"<chart type>","look":{<chart parameters>}}

Chart types:

  • Scatter plot
  • Line chart
  • Bar chart
  • Density plot
  • Tree map
  • Matrix plot
  • Histogram
  • Filters
  • 3D scatter plot
  • Grid
  • Column viewer
  • Calendar
  • Trellis plot
  • Box plot
  • Pie chart
  • Heat map
  • PC Plot
  • Statistics
  • Correlation plot
  • Map
  • Form designer
  • Web viewer
  • Markup Viewer
  • Word cloud
  • Network diagram
  • Protein viewer
  • Globe
  • Card
  • Viewer host
  • R Viewer

See also: