### RubyFCA CLI: Full Customization Example Source: https://context7.com/yohasebe/rubyfca/llms.txt An example of using RubyFCA with extensive customization options for XLSX to SVG conversion. It includes options for full output, coloring, node separation, rank separation, and edge straightening. ```bash rubyfca input.xlsx output.svg --full --coloring 1 --nodesep 0.8 --ranksep 0.3 --straight ``` -------------------------------- ### Install RubyFCA Gem Source: https://github.com/yohasebe/rubyfca/blob/master/README.md This command installs the RubyFCA gem, which is the command-line tool for Formal Concept Analysis. Ensure you have Ruby and its package manager, RubyGems, installed. ```bash gem install rubyfca ``` -------------------------------- ### RubyFCA Usage Example Source: https://github.com/yohasebe/rubyfca/blob/master/README.md This example demonstrates how to use the RubyFCA command-line tool to convert an input file to an output file with specific options. The options control aspects like concept label contraction, node coloring, edge straightening, and node/rank separation. ```bash rubyfca input_file output_file --coloring 1 --full --nodesep 0.8 --ranksep 0.3 --straight ``` -------------------------------- ### rubyfca: Combined Visualization Options Example (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt An example demonstrating the combined use of multiple visualization options for comprehensive graph customization, including full labels, coloring, edge straightening, node/rank separation, circle nodes, and legend. ```bash # Combined example with all visualization options rubyfca data.xlsx result.svg \ --full \ --coloring 1 \ --straight \ --nodesep 0.8 \ --ranksep 0.3 \ --circle \ --legend ``` -------------------------------- ### CXT Input Data Example Source: https://github.com/yohasebe/rubyfca/blob/master/README.md This example shows input data in CXT format, commonly used by FCA software like Conexp. It typically includes information about objects, attributes, and their relationships. ```text B 6 6 Ostrich Sparrow Eagle Lion Bonobo Human being bird mammal ape flying preying talking XXX... ...XXX ....XX .XX... ..XX.. .....X ``` -------------------------------- ### RubyFCA Usage with Monochrome Coloring Source: https://github.com/yohasebe/rubyfca/blob/master/README.md This example demonstrates using RubyFCA with monochrome coloring (`--coloring 2`) and adjusted node and rank separation for the output graph. ```bash rubyfca input_file output_file --coloring 2 --nodesep 0.5 --ranksep 0.3 ``` -------------------------------- ### CSV Input Data Example Source: https://github.com/yohasebe/rubyfca/blob/master/README.md This is an example of input data in CSV (comma-separated values) format, representing concepts and their relationships. The first row and column typically define headers or labels. ```csv , Ostrich , Sparrow , Eagle , Lion , Bonobo , Human being bird , X , X , X , , , mammal , , , , X , X , X ape , , , , , X , X flying , , X , X , , , preying , , , X , X , , talking , , , , , , X ``` -------------------------------- ### RubyFCA Usage with Circle Nodes Source: https://github.com/yohasebe/rubyfca/blob/master/README.md This example shows how to use RubyFCA with the `--circle` option to render concept nodes as circles. It also includes options for a legend, coloring, and layout adjustments. ```bash rubyfca input_file output_file --circle --legend --coloring 1 --full --nodesep 0.8 --ranksep 0.3 --straight ``` -------------------------------- ### RubyFCA: Generate Image File Directly (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Generates image files (SVG and PNG) directly from a `FormalContext` object using specified options. This requires Graphviz to be installed on the system. ```ruby # Generate image file directly (requires Graphviz installed) context.generate_img('output.svg', 'svg', opts) context.generate_img('output.png', 'png', opts) ``` -------------------------------- ### Basic rubyfca Command Line Usage Source: https://context7.com/yohasebe/rubyfca/llms.txt Shows the fundamental command-line syntax for using the rubyfca executable to generate visualizations from input data. It specifies input and output file paths. ```bash # Basic usage with input and output files rubyfca input.csv output.svg ``` -------------------------------- ### rubyfca: Configure Coloring Schemes (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Demonstrates the --coloring or -c option to apply different color schemes to the visualization. Options include no coloring, lightblue/pink for attributes/objects, and monochrome. ```bash # No coloring (default) rubyfca input.csv output.svg --coloring 0 # Lightblue for attributes, pink for objects rubyfca input.csv output.svg --coloring 1 # Grayscale monochrome rubyfca input.csv output.svg --coloring 2 ``` -------------------------------- ### rubyfca: Display Version and Help (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Provides commands to display the rubyfca tool's version information using --version or -v, and to show the help message with available options using --help or -h. ```bash # Print version and exit rubyfca --version # Show help message rubyfca --help ``` -------------------------------- ### RubyFCA CLI: Convert CXT to PNG with Coloring Source: https://context7.com/yohasebe/rubyfca/llms.txt Converts data from CXT format to a PNG image, enabling color highlighting for concepts. This showcases the use of the `--coloring` option. ```bash rubyfca data.cxt lattice.png --coloring 1 ``` -------------------------------- ### RubyGraphviz: Create Graph and Set Defaults (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Initializes a new graph using the `RubyGraphviz` class and sets default styles for nodes and edges. This includes defining the graph layout direction and default node/edge appearance. ```ruby require_relative 'lib/rubyfca/ruby_graphviz' # Create a new graph with layout options graph = RubyGraphviz.new("mygraph", rankdir: "TB", nodesep: "0.4", ranksep: "0.2") # Set default styles for all nodes graph.node_default(shape: "record", style: "filled", color: "gray60") # Set default styles for all edges graph.edge_default(dir: "none", color: "gray60") ``` -------------------------------- ### RubyFCA CLI: Circle Nodes with Legend Source: https://context7.com/yohasebe/rubyfca/llms.txt Demonstrates using RubyFCA to create an SVG output with circle-shaped nodes, a legend, and various styling options like coloring, full output, and edge straightening. ```bash rubyfca input.csv output.svg --circle --legend --coloring 1 --full --nodesep 0.8 --ranksep 0.3 --straight ``` -------------------------------- ### RubyFCA CLI: Monochrome Coloring Scheme Source: https://context7.com/yohasebe/rubyfca/llms.txt Applies a monochrome coloring scheme to the output EPS file generated from CXT data. Includes options for node and rank separation. ```bash rubyfca data.cxt result.eps --coloring 2 --nodesep 0.5 --ranksep 0.3 ``` -------------------------------- ### RubyGraphviz: Add Nodes and Edges (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Adds individual nodes with custom properties and creates edges (both undirected and directed) between them using the `RubyGraphviz` class. This demonstrates basic graph construction. ```ruby # Add individual nodes with custom properties graph.node("node1", label: "First Node", fillcolor: "lightblue") graph.node("node2", label: "Second Node", fillcolor: "pink") graph.node("node3", label: "Third Node", fillcolor: "lightyellow") # Create undirected edges between nodes graph.edge("node1", "node2", label: "connection") graph.edge("node2", "node3") # Create directed edges (arrows) graph.arrow_edge("node1", "node3", color: "red") ``` -------------------------------- ### RubyFCA: FormalContext Class Initialization and Calculation (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Initializes a `FormalContext` object from CSV data using Ruby, enabling label contraction. It then performs the formal concept analysis calculation. ```ruby require 'rubyfca' csv_data = <<~CSV ,Ostrich, Sparrow, Eagle, Lion, Bonobo, Human bird ,X,X,X,,, mammal ,,,,X,X,X ape ,,,,,X,X flying ,,X,X,,, preying,,,X,X,, talking,,,,,,X CSV # Initialize with CSV mode and label contraction enabled context = FormalContext.new(csv_data, 'csv', label_contraction: true) # Perform the formal concept analysis calculation context.calcurate ``` -------------------------------- ### Add Subgraph and Generate DOT Output (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Demonstrates how to add a subgraph to a graph object and then generate its DOT representation. This is useful for creating custom graph structures programmatically. ```ruby legend = RubyGraphviz.new("legend", rankdir: "LR") legend.node_default(shape: "plaintext") legend.node("l1", label: "Legend Item 1") graph.subgraph(legend) dot_string = graph.to_dot puts dot_string ``` -------------------------------- ### RubyFCA: Generate DOT Output with Options (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Generates Graphviz DOT format output from a `FormalContext` object with various options applied. This includes settings for concept label contraction, coloring, edge straightening, and node/rank separation. ```ruby # Generate DOT format output with options opts = { full: true, # Do not contract concept labels coloring: 1, # 0=none, 1=lightblue/pink, 2=monochrome straight: true, # Straighten edges nodesep: 0.8, # Separation between sister nodes ranksep: 0.3, # Separation between ranks circle: false, # Use record shapes (not circles) legend: false # No legend } dot_output = context.generate_dot(opts) puts dot_output ``` -------------------------------- ### RubyFCA CLI: Generate Graphviz DOT Format Source: https://context7.com/yohasebe/rubyfca/llms.txt Generates the raw Graphviz DOT format from a CSV file. This is useful for further processing or manual editing of the graph definition. ```bash rubyfca data.csv output.dot ``` -------------------------------- ### RubyFCA CLI: Convert CSV to SVG Source: https://context7.com/yohasebe/rubyfca/llms.txt Basic command-line usage for RubyFCA to convert a CSV input file to an SVG output file. This demonstrates the simplest invocation of the tool. ```bash rubyfca input.csv output.svg ``` -------------------------------- ### rubyfca: Straighten Edges with Neato (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Applies the --straight or -s option to straighten edges using neato post-processing, which is supported for PNG, JPG, SVG, PDF, and EPS output formats. ```bash # Straighten edges using neato rubyfca input.csv output.svg --straight ``` -------------------------------- ### rubyfca: Use Circle Nodes (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Switches node shapes to circles using the --circle or -i option, providing an alternative visual style to the default record boxes. ```bash # Use circle-shaped nodes rubyfca input.csv output.svg --circle ``` -------------------------------- ### RubyGraphviz: Align Nodes on Rank (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Aligns specified nodes on the same rank within a graph using the `RubyGraphviz` class. This is useful for controlling the layout and visual structure of the graph. ```ruby # Align nodes on the same rank graph.rank("node1", "node2", style: "invis") ``` -------------------------------- ### rubyfca: Adjust Node and Rank Separation (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Configures the horizontal separation between sibling nodes using --nodesep or -n, and the vertical separation between hierarchy ranks using --ranksep or -r. Values range from 0.1 to 5.0. ```bash # Set horizontal separation between sibling nodes rubyfca input.csv output.svg --nodesep 0.8 # Set vertical separation between hierarchy ranks rubyfca input.csv output.svg --ranksep 0.5 ``` -------------------------------- ### rubyfca: Control Concept Label Contraction (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Uses the --full or -f option to prevent the contraction of concept labels, ensuring all inherited attributes and objects are displayed. This is useful for detailed analysis. ```bash # Do not contract concept labels rubyfca input.csv output.svg --full ``` -------------------------------- ### rubyfca: Print Legend with Circle Nodes (Ruby) Source: https://context7.com/yohasebe/rubyfca/llms.txt Enables the printing of a legend when using the --circle option with the --legend or -l flag. The legend is only displayed in conjunction with circle-shaped nodes. ```bash # Print legend when using circle nodes rubyfca input.csv output.svg --circle --legend ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.