<commit_before>/* Add menu to extension bar */
ExtensionBar.addExtensionMenu({
	id : "geo-extension",
	label : "geo extension",
	submenu : [
	
	{
		id : "geo-extension/about",
		label : "About...",
		click:dialogHandler(AboutDialog)
	} ]
});

// Add submenu to column header menu 
DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
	MenuSystem.appendTo(menu, "", [ { /* separator */}, {
		id : "geo-extension/about",
		label : "geo extension",
        submenu : [
            {
                id : "geo-extension/convert",
                label : "Convert",
                submenu: [
                    {
                        id : "geo-extension/convertWkt",
                        label : "WKT to WKT (different projections)",
                        click:dialogHandler(geoConvertDialog, column)
                    },
                    {
                        id : "geo-extension/convertCoordToWkt",
                        label : "Latitude and Longitude to WKT point",
                        click:dialogHandler(geoCoordToWktConvertDialog, column)
                    }
                ]

            },
            {
                id : "geo-extension/visualize",
                label : "Visualize wkt objects",
                submenu: [
                    {
                        id:"geo-extension/showGeo",
                        label: "All",
                        click: dialogHandler(geoShowDialog,column,"all")
                    },
                    {
                        id: "geo-extension/showGeo",
                        label: "What you see",
                        click: dialogHandler(geoShowDialog,column,"wys")
                    }
                ]
            },
            {
                id : "geo-extension/facets",
                label : "Facet by",
                submenu : [
                    {
                        id : "geo-extension/facets/distance",
                        label : "Distance",
                        click:dialogHandler(geoDistanceFacetDialog,column)
                    },
                    {
                        id : "geo-extension/facets/area",
                        label : "Area",
                        click:dialogHandler(geoAboutDialog)
                    },
                    {
                        id : "geo-extension/facets/type",
                        label : "Type",
                        click:dialogHandler(geoAboutDialog)
                    },
                ]
            },
        ]
	} ]);
});



function dialogHandler(dialogConstructor) {
	var dialogArguments = Array.prototype.slice.call(arguments, 1);
	function Dialog() {
		return dialogConstructor.apply(this, dialogArguments);
	}
	Dialog.prototype = dialogConstructor.prototype;
	return function() {
		new Dialog().show();
	};
}<commit_msg>Facet by type added<commit_after>/* Add menu to extension bar */
ExtensionBar.addExtensionMenu({
    id: "geo-extension",
    label: "geo extension",
    submenu: [

        {
            id: "geo-extension/about",
            label: "About...",
            click: dialogHandler(AboutDialog)
        }
    ]
});

// Add submenu to column header menu 
DataTableColumnHeaderUI.extendMenu(function (column, columnHeaderUI, menu) {
    MenuSystem.appendTo(menu, "", [
        { /* separator */},
        {
            id: "geo-extension/about",
            label: "geo extension",
            submenu: [
                {
                    id: "geo-extension/convert",
                    label: "Convert",
                    submenu: [
                        {
                            id: "geo-extension/convertWkt",
                            label: "WKT to WKT (different projections)",
                            click: dialogHandler(geoConvertDialog, column)
                        },
                        {
                            id: "geo-extension/convertCoordToWkt",
                            label: "Latitude and Longitude to WKT point",
                            click: dialogHandler(geoCoordToWktConvertDialog, column)
                        }
                    ]

                },
                {
                    id: "geo-extension/visualize",
                    label: "Visualize wkt objects",
                    submenu: [
                        {
                            id: "geo-extension/showGeo",
                            label: "All",
                            click: dialogHandler(geoShowDialog, column, "all")
                        },
                        {
                            id: "geo-extension/showGeo",
                            label: "What you see",
                            click: dialogHandler(geoShowDialog, column, "wys")
                        }
                    ]
                },
                {
                    id: "geo-extension/facets",
                    label: "Facet by",
                    submenu: [
                        {
                            id: "geo-extension/facets/distance",
                            label: "Distance",
                            click: dialogHandler(geoDistanceFacetDialog, column)
                        },
                        {
                            id: "geo-extension/facets/area",
                            label: "Area",
                            click: dialogHandler(geoAboutDialog)
                        },
                        {
                            id: "geo-extension/facets/type",
                            label: "Type",
                            click: function () {
                                ui.browsingEngine.addFacet(
                                    "list",
                                    {
                                        "name": column.name,
                                        "columnName": column.name,
                                        "expression": "grel:value.replace(/[^a-zA-Z]/,\"\")"
                                    }
                                )
                            }
                        },
                    ]
                },
            ]
        }
    ]);
});


function dialogHandler(dialogConstructor) {
    var dialogArguments = Array.prototype.slice.call(arguments, 1);

    function Dialog() {
        return dialogConstructor.apply(this, dialogArguments);
    }

    Dialog.prototype = dialogConstructor.prototype;
    return function () {
        new Dialog().show();
    };
}
{'fraction_non_alphanumeric': 0.09771086188354586, 'fraction_numerical': 0.00030726686126901216, 'mean_word_length': 0.926605504587156, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1515557', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1417, 'n_words': 262}