@datagrok/grok-scripts v1.0.1
GrokScripts is a package for the Datagrok platform. This package stores a collection of sample scripts written using the internal language – GrokScript.
Grok script language is used to control or automate everything within the Datagrok platform. Use it to transform data, automate workflows, run queries, evaluate numerical expressions, execute commands, record macros, perform statistical computations, execute other scripts, etc.
Info panel
Separately, here are samples of using Grok script to create Info Panels.
Info Panels provide additional information about the current context (which can be a table, a column, or pretty much any other object in Datagrok platform). Info panels are meant to be easily developed by the users of the platform, and shared with other users. You can use all features of the Grok platform, such as scripting, data querying and transformation pipeline, user-defined functions, markup, viewers, predictive models.
Info Panels are displayed as a separate tab in the Property Panel. Property Panel is part of Datagrok which displays the properties of the current object in Datagrok platform. You can read more about it on our Wiki.
Example
# name: scatter plot
# description: panel that contains an interactive scatter plot
# language: grok
# tags: panel
# input: dataframe table
# condition: table.name == "demog" && table.columns.containsall(["height", "weight", "age", "sex"])
# output: viewer plot
plot = table.ScatterPlot("height", "weight", "age", "sex")
plot.showRegressionLine = true
This example is an Info Panel written in a Grok script.
Definition of Info Panel is determined by the special tag #panel
in script header.
User will see this panel, which shows a scatter plot, after opening a table with the name "demog", in which there will be columns height, weight, age and sex. Panel display conditions are defined in the script header.
Detailed information about scripting, Grok scripting and everything else can be found on our Wiki:
Also join our community where you can ask your questions, suggest improvements, or create discussions with other users.