Skip to content

Releases: opusonesolutions/asciigraf

ascii_string graph attribute

02 Nov 14:29
Compare
Choose a tag to compare

To provide useful error handling, asciigraf generates error messages that hightlight bad edges using colour (see the highlight_bad_edge_characters function).

For libraries that use asciigraf, there may at times be value in being able to generate similar highlighting to provide more specific feedback related to the use-case (e.g. if a library has specific rules about how to name nodes and what the names imply, it would be useful to highlight invalid ones in an error message).

Including the ascii string as a graph attribute makes this functionality easier to build, since the calling code can reproduce the input text just by having the graph object produced by asciigraf. Libraries can do things like defining a function to produce highlighting:

def highlight_node(asciigraf_obj: networkx.Graph, node: str) -> str:
    ...

def highlight_edge(asciigraf_obj: networkx.Graph, edge: Tuple[str, str]) -> str:
    ...

These functions can find the positions of node or edge using node / edge attributes on the input graph, and can reconstruct a highlighted textual version of the source asciigram. Without the change here, we would need to pass the ascii string separately.

Fix build

20 Jan 17:24
f08b8bb
Compare
Choose a tag to compare

we switched to pyproject.toml, however there are some small details of how setuptools loads the package VERSION from a file, and if you do it wrong the package is built in a way that pip / setuptools can't handle. For details, see bug

Version 1

13 Jan 20:10
9c06188
Compare
Choose a tag to compare

Key Changes

  • distributed using pyproject.toml
  • tested against py 3.8-3.11 and networkx 2.4-3.0
  • version attribute
  • moving to 1.0.0 because, well, this is stable code so

Support for networkx 3.0

12 Jul 13:03
7e8b658
Compare
Choose a tag to compare

In version 2.6, networkx deprecated OrderedGraph since python dictionaries are ordered as of python 3.7, and thus Graph already guarantees order in its implementation. In order to provide compatibility with networkx 3.0, when OrderedGraph will not be available, we stop using OrderedGraph for python versions newer than 3.7.

In addition, we switch from travis CI (RIP 💀 ) to Github Actions

More Node Characters

04 Oct 02:38
b70bef9
Compare
Choose a tag to compare

This release adds support for a much larger range of node characters; you can now use any character that isn't already recognized by asciigraf as an edge character (\, /, -), including single white-space characters.

      Bob is my *favourite* friend--------------------------Betty isn't my friend at all
                         \
                          \
                   what is your name, 'frank' or something?

Add points to edges

05 Nov 19:40
8b839e1
Compare
Choose a tag to compare

Each edge now gets an extra edge attribute 'points' which contains the position of edge characters in it

  • edge characters are always ordered from n1->n2, where n1 is in lower lexical position then n2 if you read the asciigram left-right, top-bottom
  • the positions of any label characters that intersect the line are included
    ** for a horizontal label, all the characters will appear in the line
    ** for a vertical label, only the one that intersects with the edge will be included

One other change is that the data attached in 'positions' attribute for nodes and 'points' attribute for edges is no longer a special asciigraf points object; it is just an (x, y) tuple. This is safer because it means that users of asciigraf won't accidentally depend on the functionality of this tuple, which is specifically designed to make parsing asciigrams easier.

Rewrite edge exploration to support all configurations

26 Oct 16:23
e9488ea
Compare
Choose a tag to compare

This release includes a complete rewrite of the edge exploring algorithm.

The rewrite adds support for edges like:

   -----n2
   |
   n1

Fix vertical label bug

20 Oct 20:41
2dac75c
Compare
Choose a tag to compare

Bugs fixed:

  • one character vertical labels not detected

Support for more corner types

12 Oct 17:06
f55cc64
Compare
Choose a tag to compare

Adds support for some extra corner configurations that were not handled before:

       1-|
         |
         2      


        1
        |
        |--2 


        1
        |
        ---2 

networkx 2.x support

22 Aug 18:02
37028d6
Compare
Choose a tag to compare
  • Adds networkx 2.x support
  • Implements release-from-tag functionality using travis ci