Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
flood = Function({},
Try(:"neighbors_dir+diag"n<< get name(), Caption("can you tell me the direct and diagonal neighbors ?!?"); stop());
dt = current data table();
nr = n rows(dt = dt);
Try(:wall; dt << delete column(:wall));
new column("wall", Nominal, set each value(1));
:wall[1]=2;
dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :X ), Y( :Y ), Color( :wall ) ),
Elements( Points( X, Y, Legend( 4 ) ) )
);
wait(1);
dt << begin data update();
// mark additional pixels as wall "2" if the neighboring pixel belongs to wall 2 - swipe from top to bottom, then inverse - and so on ...
for( i = 1, i<16, i++ ,
dt << begin data update();
for each ({rw}, 1::nr,
if(rw>1,
:wall[rw] = max(:wall[:"neighbors_dir+diag"n[rw]])));
for each ({rw}, reverse(1::nr),
if(rw>1,
:wall[rw] = max(:wall[:"neighbors_dir+diag"n[rw]])));
dt << end data update();
wait(0.1);
);
)