{"id":19268381,"url":"https://github.com/permutatriangle/tilingsgui","last_synced_at":"2025-04-21T19:33:21.790Z","repository":{"id":56297214,"uuid":"193712058","full_name":"PermutaTriangle/tilingsgui","owner":"PermutaTriangle","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-06T21:19:16.000Z","size":767,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T23:07:28.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PermutaTriangle.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-25T13:22:05.000Z","updated_at":"2025-02-06T21:19:20.000Z","dependencies_parsed_at":"2025-02-06T22:23:46.023Z","dependency_job_id":"f1e45360-5de2-4c14-b54c-c4dc0eafcff7","html_url":"https://github.com/PermutaTriangle/tilingsgui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2Ftilingsgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2Ftilingsgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2Ftilingsgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2Ftilingsgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PermutaTriangle","download_url":"https://codeload.github.com/PermutaTriangle/tilingsgui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250120211,"owners_count":21378154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:16:01.653Z","updated_at":"2025-04-21T19:33:21.439Z","avatar_url":"https://github.com/PermutaTriangle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tilings GUI\n===========\n\nA graphical interface for `Tilings`_.\n\nInstall and run\n---------------\n\n.. code:: sh\n\n   pip install tilingsgui\n   tilingsgui\n   tilingsgui -j 'tilingsgui json object'\n\nNote for Linux\n~~~~~~~~~~~~~~\n\nPyperclip requires clipboard tools that might not come pre-installed.\n\n.. code:: sh\n\n   sudo apt-get install xclip\n\nWithout them the app still works but pasting won’t.\n\nKnown issues\n------------\n* \n\nReport a bug\n~~~~~~~~~~~~\nAlong with the description of the bug, please provide a json of the tiling which is exportable in the gui.\n\nUser manual\n-----------\n\nSummary\n~~~~~~~\n* |add_point| Point insertion\n* |add_custom| Permutation insertion\n* |export| Export\n* |factor| Factor\n* |factor_int| Factor with interleaving\n* |fusion_c| Fusion with column set\n* |fusion_r| Fusion with row set\n* |fusion_comp_c| Component fusion with column set\n* |fusion_comp_r| Component fusion with row set\n* |htc| Highlight hovered cell\n* |move| Move\n* |obstr_trans| Obstruction transitivity\n* |place_east| East placement\n* |place_north| North placement\n* |place_south| South placement\n* |place_west| West placement\n* |pplace_east| East partial placement\n* |pplace_north| North partial placement\n* |pplace_south| South partial placement\n* |pplace_west| West partial placement\n* |pretty| Pretty points\n* |undo| Undo\n* |redo| Redo\n* |rowcolsep| Row column separation\n* |sequence| Sequece\n* |shading| Shading\n* |show_cross| Show crossing\n* |show_local| Show localized\n* |str| Print\n* |verification| Verification\n* |tikz| Tikz\n* |obstruction_inferral| Obstruction inferral\n\nTiling input\n~~~~~~~~~~~~\nThe input box directly above the tiling canvas can be used to create an initial tiling. It accepts both strings and json, using ``from_string`` and ``from_json`` respectively. A right click activates it. To confirm your input, press enter or click away from the text box. Escape cancels the input. Right clicking when activated will paste whatever is on the clipboard.\n\n**Example**:\nThe following two inputs are two ways of producing the same initial tiling.\n\n.. code::\n\n   1432_12345\n   \n   {\"class_module\": \"tilings.tiling\", \"comb_class\": \"Tiling\", \"obstructions\": [{\"patt\": [0, 3, 2, 1], \"pos\": [[0, 0], [0, 0], [0, 0], [0, 0]]}, {\"patt\": [0, 1, 2, 3, 4], \"pos\": [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]}], \"requirements\": [], \"assumptions\": []}\n   \nThe initial tiling in question would be the following.\n\n.. code:: sh\n\n   +-+\n   |1|\n   +-+\n   1: Av(0321, 01234)\n   \n\nCell insertion\n~~~~~~~~~~~~~~\nTo insert a permutation into a single cell, one can choose either to add a point, |add_point|, or a custom permutation, |add_custom|. For the latter, the latest confirmed input in the text box above the button grid is used. The text box works just like the one for inputting tilings. It uses ``to_standard`` to convert the input to a permutation. After having selected the permutation to insert, then clicking a cell will insert it. Left click inserts it as a requirement while a right click inserts it as a obstruction, using ``add_single_cell_requirement`` and ``add_single_cell_obstruction`` respectively.\n\nFactor\n~~~~~~\nThere are two types of factorization, factor |factor| and factor with interleaving |factor_int|. In both cases they are applied to the cell that is clicked. Two active cells are in the same factor if they are in the same row or column, or they share an obstruction or a requirement. For factoring with interleaving, two non-empty cells are in the same factor if they share an obstruction or a requirement.\n\nPlace points\n~~~~~~~~~~~~\nBy clicking a point of a requirement, we pass its gridded permutation along with its index within it to ``place_point_of_gridded_permutation`` and the direction set by the button chosen, east |place_east|, north |place_north|, south |place_south| or west |place_west|.\n\n.. code:: python\n\n   def place_point_of_gridded_permutation(\n           self, gp: GriddedPerm, idx: int, direction: int\n       ) -\u003e \"Tiling\":\n           \"\"\"\n           Return the tiling where the directionmost occurrence of the idx point\n           in the gridded permutaion gp is placed.\n           \"\"\"\n\nPartially place points\n~~~~~~~~~~~~~~~~~~~~~~\nBy clicking a point of a requirement, we pass its gridded permutation along with its index within it to ``partial_place_point_of_gridded_permutation`` and the direction set by the button chosen, east |pplace_east|, north |pplace_north|, south |pplace_south| or west |pplace_west|.\n\n.. code:: python\n\n    def partial_place_point_of_gridded_permutation(\n        self, gp: GriddedPerm, idx: int, direction: int\n    ) -\u003e \"Tiling\":\n        \"\"\"\n        Return the tiling where the directionmost occurrence of the idx point\n        in the gridded permutaion gp is placed. The point is placed onto its\n        own row or own column depending on the direction.\n        \"\"\"\n\nFusion\n~~~~~~\nLet ``c_r`` and ``c_c`` be the row and column respectively of the clicked cell. There are 4 types of fusions available. Fusion with ``row=c_r``, |fusion_r|, fusion with ``col=c_c``, |fusion_c|, component fusion with ``row=c_r``, |fusion_comp_r|, and component fusion with ``col=c_c``, |fusion_comp_c|. If the fusion are invalid, then exceptions are caught and nothing happens. \n\nFusion:\n\n.. code:: python\n\n   \"\"\"\n   Fuse the tilings.\n   If `row` is not `None` then `row` and `row+1` are fused together.\n   If `col` is not `None` then `col` and `col+1` are fused together.\n   \"\"\"\n\nComponent fusion:\n\n.. code:: python\n\n   \"\"\"\n   Fuse the tilings in such a way that it can be unfused by drawing a line between skew/sum-components.\n   If `row` is not `None` then `row` and `row+1` are fused together.\n   If `col` is not `None` then `col` and `col+1` are fused together.\n   \"\"\"\n\nUndo and redo\n~~~~~~~~~~~~~\nGiven that there are previously drawn tilings, then undo, |undo|, will redraw the one before the last action. If you wish to revert the undo, you can use redo, |redo|. There is a limit on how many tilings are stored in memory.\n\nRow column separation\n~~~~~~~~~~~~~~~~~~~~~\n|rowcolsep| splits the row and columns of a tilings using the inequalities implied by the length two obstructions.\n\nObstruction transitivity\n~~~~~~~~~~~~~~~~~~~~~~~~\n|obstr_trans| adds length 2 obstructions to the tiling using transitivity over positive cells.\n\nExport\n~~~~~~\nExport, |export|, will store the current tiling in memory and upon closing the app, will add all stored tilings in the session to ``./export/history.json``. There is a session limit so the file become too large. If the session limit is reached, than adding more will remove the oldest. The format of the json can be seen below with time and tiling values empty. Any time export is used, a copy of the history is placed in the current working directory.\n\n.. code:: JSON\n\n  [\n    {\n      \"session_time\": \"\",\n      \"tilings\": [\n        {\n          \"tiling_time\": \"\",\n          \"tiling\": {}\n        },\n        {\n          \"tiling_time\": \"\",\n          \"tiling\": {}\n        }\n      ]\n    },\n    {\n      \"session_time\": \"\",\n      \"tilings\": [\n        {\n          \"tiling_time\": \"\",\n          \"tiling\": {}\n        }\n      ]\n    }\n  ]\n\nPrint\n~~~~~\nWriting the current tiling to ``stdout``, |str|, will produce both the ``__str__`` and ``__repr__`` representation of the tiling. An example output is shown below.\n\n.. code:: sh\n\n   +-+-+-+\n   | |●| |\n   +-+-+-+\n   |1| |1|\n   +-+-+-+\n   1: Av(021)\n   ●: point\n   Crossing obstructions:\n   01: (0, 0), (2, 0)\n   Requirement 0:\n   0: (1, 1)\n\n   Tiling(obstructions=(GriddedPerm(Perm((0,)), ((0, 1),)), GriddedPerm(Perm((0,)), ((1, 0),)), GriddedPerm(Perm((0,)), ((2, 1),)), GriddedPerm(Perm((0, 1)), ((0, 0), (2, 0))), GriddedPerm(Perm((0, 1)), ((1, 1), (1, 1))), GriddedPerm(Perm((1, 0)), ((1, 1), (1, 1))), GriddedPerm(Perm((0, 2, 1)), ((0, 0), (0, 0), (0, 0))), GriddedPerm(Perm((0, 2, 1)), ((2, 0), (2, 0), (2, 0)))), requirements=((GriddedPerm(Perm((0,)), ((1, 1),)),),), assumptions=())\n\nSequence\n~~~~~~~~\nThe first few terms of the sequence of gridded permutations griddable on the current tiling can be written to ``stdout``, |sequence|, where for example the following tiling\n\n.. code:: sh\n\n   +-+-+-+-+\n   | |●| | |\n   +-+-+-+-+\n   |1| |1| |\n   +-+-+-+-+\n   | | | |●|\n   +-+-+-+-+\n   | | |1| |\n   +-+-+-+-+\n   1: Av(021)\n   ●: point\n   Crossing obstructions:\n   01: (0, 2), (2, 2)\n   01: (2, 0), (2, 2)\n   Requirement 0:\n   0: (1, 3)\n   Requirement 1:\n   0: (3, 1)\n\nwould produce this output.\n\n.. code:: sh\n\n   [0, 0, 1, 3, 9, 28, 90, 297]\n\nShading\n~~~~~~~\nWith shading on, |shading|, then a 1 restriction is not drawn as a point but rather as a filled cell.\n\nPretty points\n~~~~~~~~~~~~~\nWith pretty points on, |pretty|, then 12 and 21 restrictions along with a 1 requirement within the same cell are drawn as a single point.\n\nShow localized\n~~~~~~~~~~~~~~\nWith localized shown, |show_local|, requirements and obstructions that are contained in a single cell are shown. Without it they are not.\n\nShow crossing\n~~~~~~~~~~~~~\nWith crossing shown, |show_cross|, requirements and obstructions that reach across different cells are shown. Without it they are not.\n\nHighlight hovered cell\n~~~~~~~~~~~~~~~~~~~~~~\nTurning on the hovered cell highlighting, |htc|, obstructions in the hovered cell are colored differently.\n\nObstruction inferral\n~~~~~~~~~~~~~~~~~~~~\nAdd all obstructions up to a length that does not change the set of gridded permutations. Pressing |obstruction_inferral| will use the upper right input box to determine the lenght. It is maxed at 7 and defaults to 3.\n\nTikz\n~~~~\nUse |tikz| to produce the current tiling with the current positions as a tikz figure.\n\nVerification\n~~~~~~~~~~~~\nGiven a tiling ``t``, the verification button, |verification|, will produce the following result.\n\n.. code:: python\n\n   [\n      BasicVerificationStrategy().verified(t),\n      DatabaseVerificationStrategy().verified(t),\n      ElementaryVerificationStrategy().verified(t),\n      InsertionEncodingVerificationStrategy().verified(t),\n      LocallyFactorableVerificationStrategy().verified(t),\n      LocalVerificationStrategy(no_factors=False).verified(t),\n      MonotoneTreeVerificationStrategy().verified(t),\n      OneByOneVerificationStrategy().verified(t)\n   ]\n\nAn example output is shown below.\n\n.. code:: sh\n\n   BasicVerificationStrategy             : True\n   DatabaseVerificationStrategy          : False\n   ElementaryVerificationStrategy        : False\n   InsertionEncodingVerificationStrategy : True\n   LocallyFactorableVerificationStrategy : False\n   LocalVerificationStrategy             : True\n   MonotoneTreeVerificationStrategy      : False\n   OneByOneVerificationStrategy          : True\n\n\n.. _Tilings: https://github.com/PermutaTriangle/Tilings\n\n.. |add_point| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/add_point.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |add_custom| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/add_custom.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |export| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/export.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |factor| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/factor.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |factor_int| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/factor_int.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |fusion_c| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/fusion_c.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |fusion_comp_c| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/fusion_comp_c.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |fusion_comp_r| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/fusion_comp_r.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |fusion_r| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/fusion_r.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |htc| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/htc.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |move| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/move.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |obstr_trans| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/obstr_trans.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |place_east| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/place_east.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |place_north| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/place_north.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |place_south| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/place_south.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |place_west| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/place_west.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |pplace_east| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/pplace_east.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |pplace_north| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/pplace_north.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |pplace_south| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/pplace_south.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |pplace_west| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/pplace_west.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |pretty| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/pretty.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |redo| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/redo.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |rowcolsep| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/rowcolsep.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |sequence| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/sequence.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |shading| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/shading.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |show_cross| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/show_cross.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |show_local| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/show_local.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |str| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/str.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |undo| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/undo.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |verification| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/verification.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |tikz| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/tikz.svg\n   :scale: 200 %\n   :alt: img-error\n\n.. |obstruction_inferral| image:: https://raw.githubusercontent.com/PermutaTriangle/tilingsgui/develop/tilingsgui/resources/img/svg/obs_inf.svg\n   :scale: 200 %\n   :alt: img-error\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutatriangle%2Ftilingsgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermutatriangle%2Ftilingsgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutatriangle%2Ftilingsgui/lists"}