<jupyter_start><jupyter_text>Non Decreasing Parking FunctionsA non-decreasing parking function of size n is a non-decreasing function f from {1,…,n} to itself such that for all i, one has f(i)≤i. (http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/non_decreasing_parking_function.html)<jupyter_code>from sage_francy import FrancyWidget
E = FiniteSetMaps(4)
f1 = E([0,0,2,3])
f2 = E([0,1,1,3])
f3 = E([0,1,2,2])
H = E.submonoid([f1, f2, f3])
g = H.cayley_graph(side='twosided', simple=True)
import networkx
G = networkx.DiGraph()
G.add_edges_from([(e[0], e[1]) for e in g.edges()])<jupyter_output><empty_output><jupyter_text>For specific layout options, we write a function called _node__options_ , that should return an _options_ dictionary. In our case:- Idempotent maps will be highlighted with a diamond shaped node- Level sets will be grouped in the final layout<jupyter_code>llvs = g.level_sets()
levels = {}
for lvs in llvs:
    for n in lvs:
        levels[n] = llvs.index(lvs)

def node_options(n):
    options = {}
    if n.is_idempotent():
        options['type'] = 'diamond'       
    else:
        options['type'] = 'circle'
    options['layer'] = levels[n]
    options['modal_menus'] = [{
        'title': 'cardinality',
        'funcname': 'cardinality',
        'is_method': True
    }]
    return options
from sage_francy import FrancyWidget
w = FrancyWidget(G, 
                  title="NDPF4", height=600, weight=0, graphType="directed",
                  node_options=node_options)
w<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1305753070458953, 'fraction_numerical': 0.017453135100193924, 'mean_word_length': 3.9935483870967743, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '423544', 'license': 'BSL-1.0', 'n_tokens_mistral': 565, 'n_tokens_neox': 542, 'n_words': 138, 'path': 'examples/NDPF4.ipynb', 'repo_name': 'zerline/sage-francy', 'size': '1547'}