Below is example for the script (requires JMP16 due to Transform Each() and For Each())
Names Default To Here(1);
If(Is Empty(Current Data Table()),
Throw("No tables open.");
, // else
dt = Current Data Table();
);
sel_cols = dt << Get Selected Columns();
If(N Items(sel_cols) == 0,
Throw("No columns selected");
);
// color "globals", fairly free to choose which type of "JMP Color" to use
LOW_COLOR = 67;
MIDDLE_COLOR = -13948116;
HIGH_COLOR = "Light Green";
For Each({col_ref}, sel_cols,
col_name = col_ref << get name; // I don't like using :COLNAME format at all
// get values in column
// Associative Array seems to have a bug so we use Summarize
Summarize(dt, val_strs = By(Column(col_name)));
// Summarize returns list of characters, so we will convert them to numbers
vals = Transform Each({val}, val_strs, Num(val));
min_val = Remove From(vals, 1)[1];
max_val = Remove From(vals, -1)[1];
// This method should be fairly robust, but it does looks complicated
weird_jmp_list = {};
Eval(Substitute(Expr(
Insert Into(weird_jmp_list, Expr(_value_ = _color_))
),
Expr(_value_), min_val,
Expr(_color_), LOW_COLOR
));
Eval(Substitute(Expr(
Insert Into(weird_jmp_list, Expr(_value_ = _color_))
),
Expr(_value_), max_val,
Expr(_color_), HIGH_COLOR
));
// color rest with middle color
For Each({val}, vals,
Eval(Substitute(Expr(
Insert Into(weird_jmp_list, Expr(_value_ = _color_))
),
Expr(_value_), val,
Expr(_color_), MIDDLE_COLOR
));
);
Column(dt, col_name) << set property( "Value Colors", weird_jmp_list) << Color Cell By Value(1);
);
-Jarmo