Find longest consecutive characters in 2D array Challenge

Given a 2D array, find the length and direction of all the longest consecutive characters.


If there are ties, output every possible winning combination in any order, (winners can overlap with other winners)
Zero "0" is a special padding character which cannot be a winner.
Code golf rules apply, shortest code wins.


Output: n,m,d

(Where n is the identified character of length m in d direction)

Valid characters for d: /|\-. See below examples to interpret meaning.

Input: The 2D array input should be in either of the following format, (your preference):

Option 1:

123
456
789


Option 2*:

[["123"],["456"],["789"]]


*or any combination of "{[()]}" characters can be used, with whitespace characters ignored outside of quotes. Quotes can be single or double. The array must read left-to-right, top-to-bottom.

Assumptions


The shape of the array will always be rectangular or square
There will always be at least one non-zero character
Array characters will only be alphanumeric


Examples

1.

0000000
0111100
0000000



  1,4,-


2.

00000000
aaaa0000
00bbbbb0



  b,5,-


3.

0y00x000
aayxaaaz
00xy000z
0x00y00z
x0000y0z



  x,5,/
  
  y,5,\


*(in any order)

4.

1111
1111
1111



  1,4,-
  
  1,4,-
  
  1,4,-


5.

ccc
cwc
ccc



  c,3,-
  
  c,3,-
  
  c,3,|
  
  c,3,|


*(in any order)

6.

9



  9,1,.


7.

ab
cd



  a,1,.
  
  b,1,.
  
  c,1,.
  
  d,1,.


*(in any order)
Charcoal, 110 bytes

≔⪫Ａ⸿θＰθＦθ«≔⟦⟧ηＦ∧¬№0⸿ι⟦→↘↓↙⟧«≔ＫＤＬθ✳κζＷ›Ｌζ№ζι≔⊟ζε⊞η⟦κιＬζ⟧»¿⁼¹⌈Ｅη§κ²⊞υ⊟ηＦη⊞υκι»⎚≔⌈Ｅυ§ι²εＦΦυ⁼⊟ιε«⊟ι,Ｉε,Ｐ✳⊟ι⎇⊖ε¹.¦⸿


Try it online! Link is to verbose version of code. Takes an array of strings as input. Explanation:

≔⪫Ａ⸿θＰθ


Join the strings with carriage returns (not newlines) and output them without moving the cursor.

Ｆθ«


Loop over each character in the string.

≔⟦⟧η


Collect all of the consecutive characters starting at this position in an array.

Ｆ∧¬№0⸿ι⟦→↘↓↙⟧«


If the current character is not a 0 or a carriage return, then check all four directions.

≔ＫＤＬθ✳κζ


Peek as much as possible in that direction.

Ｗ›Ｌζ№ζι≔⊟ζε


Shorten the string until all of the characters are the same.

⊞η⟦κιＬζ⟧»


Save the results in the array.

¿⁼¹⌈Ｅη§κ²⊞υ⊟ηＦη⊞υκ


If the maximum consecutive character was 1, then only push one of the results to the final array, otherwise push all of them.

ι»


Reprint the current character, this time allowing the cursor to move.

⎚


Clear the input from the canvas.

≔⌈Ｅυ§ι²ε


Find the longest consecutive length.

ＦΦυ⁼⊟ιε«


Loop over the entries with that length.

⊟ι,Ｉε,


Output the character and length.

Ｐ✳⊟ι⎇⊖ε¹.¦⸿


If the length is 1 then output a . otherwise output a direction character. Then move to the start of the next line for the next result.