<commit_before>________________________________________________________________________

This file is part of Logtalk <http://logtalk.org/>  
Copyright (c) 1998-2014 <NAME> <<EMAIL>>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Additional licensing terms apply per Section 7 of the GNU General
Public License 3. Consult the `LICENSE.txt` file for details.
________________________________________________________________________


% start by loading the example:

| ?- logtalk_load(diagrams(loader)).
...


% check the default list of options used when generating a entity diagram:

| ?- entity_diagram(dot)::default_options(DefaultOptions).
DefaultOptions = ...
yes


% load an example for testing but be sure that the "source_data" flag is on:

| ?- set_logtalk_flag(source_data, on), logtalk_load(points(loader)).
...

% generating an entity diagram for a source file using default options:

| ?- entity_diagram(dot)::file(points).
yes


% load another example for testing:

| ?- logtalk_load(searching(loader)).
...

% generating a file loading dependencies diagram for all source files in a
% library using default options and the default graph language (DOT):

| ?- file_diagram::library(searching).
yes


% it's also possible to generate diagrams for a library and all its
% sub-libraries using the rlibrary/1 method instead of the library/1
% method:

| ?- file_diagram(dot)::rlibrary(tools).
yes


% the methods all/1, rlibrary/2, library/2, files/2, and file/2 allows
% the specification of the options to be used when generating a diagram<commit_msg>Add some examples of using the new features of the `diagrams` tool<commit_after>________________________________________________________________________

This file is part of Logtalk <http://logtalk.org/>  
Copyright (c) 1998-2014 <NAME> <<EMAIL>>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Additional licensing terms apply per Section 7 of the GNU General
Public License 3. Consult the `LICENSE.txt` file for details.
________________________________________________________________________


% start by loading the example:

| ?- logtalk_load(diagrams(loader)).
...


% check the default options used when generating a entity diagram:

| ?- entity_diagram(dot)::default_options(DefaultOptions).
DefaultOptions = ...
yes


% load an example for testing but be sure that the "source_data" flag is on:

| ?- set_logtalk_flag(source_data, on), logtalk_load(points(loader)).
...

% generating an entity diagram for a source file using default options:

| ?- entity_diagram(dot)::file(points).
yes


% load another example for testing:

| ?- logtalk_load(searching(loader)).
...

% generating a file loading dependencies diagram for all source files in a
% library using default options and the default graph language (DOT):

| ?- file_diagram::library(searching).
yes


% it's also possible to generate diagrams for a library and all its
% sub-libraries using the rlibrary/1 method instead of the library/1
% method:

| ?- file_diagram(dot)::rlibrary(tools).
yes


% all methods that generate a diagram have a variant that allows the
% specification of the options to be used when generating a diagram


% when generating a diagram for public publishing, it's often possible
% to shorten file paths in order to remove a user-dependent prefix:

| ?- file_diagram::library(searching, [omit_path_prefix('/Users/jdoe/logtalk/')]).
yes

% some final output formats such as SVG support tooltips and URL links;
% the URL protocol can be specified so that clicking in a node or a
% cluster of nodes opens the corresponding file or library of files:

| ?- entity_diagram::library(searching, [url_protocol('file:///'), omit_path_prefix('/Users/jdoe/logtalk/')]).
yes
{'fraction_non_alphanumeric': 0.07725587144622992, 'fraction_numerical': 0.00638648537288834, 'mean_word_length': 4.725235849056604, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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}}
{'dir': 'git-commits-cleaned', 'id': '4861107', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1235, 'n_words': 591}